NullOpsDecorator

Defines operations on nullable types and tree.

class Object
trait Matchable
class Any

Extensions

Extensions

extension (self: Type)

Is self (after widening and dealiasing) a type of the form T | Null?

Is self (after widening and dealiasing) a type of the form T | Null?

def stripNull(using Context): Type

Syntactically strips the nullability from this type. If the type is T1 | ... | Tn, and Ti references to Null, then return T1 | ... | Ti-1 | Ti+1 | ... | Tn. If this type isn't (syntactically) nullable, then returns the type unchanged. The type will not be changed if explicit-nulls is not enabled.

Syntactically strips the nullability from this type. If the type is T1 | ... | Tn, and Ti references to Null, then return T1 | ... | Ti-1 | Ti+1 | ... | Tn. If this type isn't (syntactically) nullable, then returns the type unchanged. The type will not be changed if explicit-nulls is not enabled.

extension (self: Tree)