RecordType

dotty.tools.sjs.ir.Types.RecordType
See theRecordType companion object
final case class RecordType(fields: List[Field]) extends Type

Record type.

Used by the optimizer to inline classes as records with multiple fields. They are desugared as several local variables by JSDesugaring. Record types cannot cross method boundaries, so they cannot appear as the type of fields or parameters, nor as result types of methods. The compiler itself never generates record types.

Record types currently do not feature any form of subtyping. For R1 to be a subtype of R2, it must have the same fields, in the same order, with equivalent types.

Record types are not subtypes of any. As such, they can never be passed to JavaScript.

Attributes

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

Members list

Value members

Concrete methods

def toNonNullable: this.type

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