object Types
- Alphabetic
- By Inheritance
- Types
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class ArrayType(arrayTypeRef: ArrayTypeRef) extends Type with Product with Serializable
Array type.
- final case class ArrayTypeRef(base: NonArrayTypeRef, dimensions: Int) extends TypeRef with Product with Serializable
Array type.
- final case class ClassRef(className: ClassName) extends NonArrayTypeRef with Product with Serializable
Class (or interface) type.
- final case class ClassType(className: ClassName) extends Type with Product with Serializable
Class (or interface) type.
- sealed abstract class NonArrayTypeRef extends TypeRef
- final case class PrimRef extends NonArrayTypeRef with Product with Serializable
Primitive type reference.
- sealed abstract class PrimType extends Type
- sealed abstract class PrimTypeWithRef extends PrimType
- final case class RecordType(fields: List[Field]) extends Type with Product with Serializable
Record 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.
- sealed abstract class Type extends AnyRef
Type of a term (expression or statement) in the IR.
Type of a term (expression or statement) in the IR.
There is a many-to-one relationship from TypeRefs to
Types, becausejava.lang.Objectand JS types all collapse to AnyType.In fact, there are two
Types that do not have any real equivalent in type refs: StringType and UndefType, as they refer to the non-null variants ofjava.lang.Stringandjava.lang.Void, respectively. - sealed abstract class TypeRef extends AnyRef
Type reference (allowed for classOf[], is/asInstanceOf[]).
Type reference (allowed for classOf[], is/asInstanceOf[]).
A
TypeRefhas exactly the same level of precision as a JVM type. There is a one-to-one relationship between aTypeRefand an instance ofjava.lang.Classat run-time. This means that:- All primitive types have their
TypeRef(includingscala.Byteandscala.Short), and they are different from their boxed versions. - JS types are not erased to
any - Array types are like on the JVM
A
TypeReftherefore uniquely identifies aclassOf[T]. It is also the type refs that are used in method signatures, and which therefore dictate JVM/IR overloading. - All primitive types have their
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final val BooleanRef: PrimRef
- final val ByteRef: PrimRef
- final val CharRef: PrimRef
- final val DoubleRef: PrimRef
- final val FloatRef: PrimRef
- final val IntRef: PrimRef
- final val LongRef: PrimRef
- final val NothingRef: PrimRef
- final val NullRef: PrimRef
- final val ShortRef: PrimRef
- final val VoidRef: PrimRef
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isSubtype(lhs: Type, rhs: Type)(isSubclass: (ClassName, ClassName) => Boolean): Boolean
Tests whether a type
lhsis a subtype ofrhs(or equal).Tests whether a type
lhsis a subtype ofrhs(or equal). NoType is never a subtype or supertype of anything (including itself). All other types are subtypes of themselves.- isSubclass
A function testing whether a class/interface is a subclass of another class/interface.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def zeroOf(tpe: Type)(implicit pos: Position): Literal
Generates a literal zero of the given type.
- case object AnyType extends Type with Product with Serializable
Any type (the top type of this type system).
Any type (the top type of this type system). A variable of this type can contain any value, including
undefinedandnulland any JS value. This type supports a very limited set of Scala operations, the ones common to all values. Basically only reference equality tests and instance tests. It also supports all JavaScript operations, since all Scala objects are also genuine JavaScript objects. The type java.lang.Object in the back-end maps to AnyType because it can hold JS values (not only instances of Scala.js classes). - object ArrayTypeRef extends Serializable
- case object BooleanType extends PrimTypeWithRef with Product with Serializable
Boolean type.
Boolean type. It does not accept
nullnorundefined. - case object ByteType extends PrimTypeWithRef with Product with Serializable
8-bit signed integer type.
8-bit signed integer type. It does not accept
nullnorundefined. - case object CharType extends PrimTypeWithRef with Product with Serializable
Chartype, a 16-bit UTF-16 code unit.Chartype, a 16-bit UTF-16 code unit. It does not acceptnullnorundefined. - case object DoubleType extends PrimTypeWithRef with Product with Serializable
Double type (64-bit).
Double type (64-bit). It does not accept
nullnorundefined. - case object FloatType extends PrimTypeWithRef with Product with Serializable
Float type (32-bit).
Float type (32-bit). It does not accept
nullnorundefined. - case object IntType extends PrimTypeWithRef with Product with Serializable
32-bit signed integer type.
32-bit signed integer type. It does not accept
nullnorundefined. - case object LongType extends PrimTypeWithRef with Product with Serializable
64-bit signed integer type.
64-bit signed integer type. It does not accept
nullnorundefined. - case object NoType extends PrimTypeWithRef with Product with Serializable
No type.
- case object NothingType extends PrimTypeWithRef with Product with Serializable
Nothing type (the bottom type of this type system).
Nothing type (the bottom type of this type system). Expressions from which one can never come back are typed as
Nothing. For example,throwandreturn. - case object NullType extends PrimTypeWithRef with Product with Serializable
The type of
null.The type of
null. It does not acceptundefined. The null type is a subtype of all class types and array types. - object RecordType extends Serializable
- case object ShortType extends PrimTypeWithRef with Product with Serializable
16-bit signed integer type.
16-bit signed integer type. It does not accept
nullnorundefined. - case object StringType extends PrimType with Product with Serializable
String type.
String type. It does not accept
nullnorundefined. - case object UndefType extends PrimType with Product with Serializable
The type of
undefined.