final case class ClassType(className: ClassName, nullable: Boolean, exact: Boolean) extends Type with Product with Serializable
Class (or interface) type.
A value of ClassType(cls, nullable, exact) can be:
- an instance of
classNameitself, - an instance of a subclass of
className, ifexact = false, or null, ifnullable = true.
nullable and exact are not mutually exclusive. A value of
ClassType(cls, nullable = true, exact = true) can hold an instance of
cls or the value null, but not an instance of a subclass of cls.
Exact interface types are not prohibited, but are necessarily uninhabited except if they are nullable. Similarly, non-nullable exact hijacked class types are uninhabited.
If a class is final, it does not automatically allow all its ClassTypes
to be exact. Removing the final modifier on a class is considered a
backward binary compatible change (unlike adding it). If we allowed exact
types for every reference to a final class, that would break that
property: removing the final modifier would invalidate all exact
references to that class in other IR files.
- Alphabetic
- By Inheritance
- ClassType
- Serializable
- Product
- Equals
- Type
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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 def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val className: ClassName
- 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
- val exact: Boolean
- 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()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isNullable: Boolean
Is
nullan admissible value of this type?Is
nullan admissible value of this type?- Definition Classes
- Type
- 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()
- val nullable: Boolean
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def show(): String
- Definition Classes
- Type
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toExact: ClassType
- def toNonExact: ClassType
- def toNonNullable: ClassType
A type that accepts the same values as this type except
null, unless this type isVoidType. - def toNullable: ClassType
- 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()