ClosureType

dotty.tools.sjs.ir.Types.ClosureType
final case class ClosureType(paramTypes: List[Type], resultType: Type, nullable: Boolean) extends Type

Closure type.

This is the type of a typed closure. Parameters and result are statically typed according to the closureTypeRef components.

Closure types may be nullable. Null() is a valid value of a nullable closure type. This is unfortunately required to have default values of closure types, which in turn is required to be used as the type of a field.

Closure types are non-variant in both parameter and result types.

Closure types are not subtypes of AnyType. That statically prevents them from going into JavaScript code or in any other universal context. They do not support type tests nor casts.

The following subtyping relationships hold for any closure type CT:

nothing <: CT <: void

For a nullable closure type CT, additionally the following subtyping relationship holds:

null <: CT

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Type
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

A type that accepts the same values as this type except null, unless this type is VoidType.

A type that accepts the same values as this type except null, unless this type is VoidType.

If this is VoidType, returns this type.

For all other types tpe, tpe.toNonNullable.isNullable is false.

Attributes

Inherited methods

Is null an admissible value of this type?

Is null an admissible value of this type?

Attributes

Inherited from:
Type

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def show(): String

Attributes

Inherited from:
Type