A class defining symbols and types of standard definitions
Attributes
- Companion
- object
- Graph
-
- Supertypes
Members list
Type members
Classlikes
Extractor for context function types representing by-name parameters, of the form () ?=> T
. Under purefunctions, this becomes () ?-> T
or {r1, ..., rN} () ?-> T
.
Extractor for context function types representing by-name parameters, of the form () ?=> T
. Under purefunctions, this becomes () ?-> T
or {r1, ..., rN} () ?-> T
.
Attributes
- Supertypes
- Self type
-
ByNameFunction.type
An extractor for context function types As ?=> B
, possibly with dependent refinements. Optionally returns a triple consisting of the argument types As
, the result type B
and a whether the type is an erased context function.
An extractor for context function types As ?=> B
, possibly with dependent refinements. Optionally returns a triple consisting of the argument types As
, the result type B
and a whether the type is an erased context function.
Attributes
- Supertypes
- Self type
-
ContextFunctionType.type
Attributes
- Supertypes
- Self type
-
FunctionNOf.type
Attributes
- Supertypes
- Self type
-
FunctionOf.type
Attributes
- Supertypes
- Self type
-
FunctionTypeOfMethod.type
An extractor for multi-dimensional arrays. Note that this will also extract the high bound if an element type is a wildcard upper-bounded by an array. E.g.
An extractor for multi-dimensional arrays. Note that this will also extract the high bound if an element type is a wildcard upper-bounded by an array. E.g.
Array[? <: Array[? <: Number]]
would match
MultiArrayOf(<? <: Number>, 2)
Attributes
- Supertypes
- Self type
-
MultiArrayOf.type
Attributes
- Supertypes
- Self type
-
PartialFunctionOf.type
Attributes
- Supertypes
Attributes
- Supertypes
- Self type
-
PolyFunctionOf.type
Attributes
- Supertypes
- Self type
-
RefinedFunctionOf.type
Types
Value members
Concrete methods
The enumeration type, goven a value of the enumeration
The enumeration type, goven a value of the enumeration
Attributes
If it is BoxedUnit, remove java.io.Serializable
from parents
.
If it is BoxedUnit, remove java.io.Serializable
from parents
.
Attributes
If cls
is Tuple1..Tuple22, add the corresponding *: type as last parent to parents
If cls
is Tuple1..Tuple22, add the corresponding *: type as last parent to parents
Attributes
Return underlying context function type (i.e. instance of an ContextFunctionN class) or NoType if none exists. The following types are considered as underlying types:
Return underlying context function type (i.e. instance of an ContextFunctionN class) or NoType if none exists. The following types are considered as underlying types:
- the alias of an alias type
- the instance or origin of a TypeVar (i.e. the result of a stripTypeVar)
- the upper bound of a TypeParamRef in the current constraint
Attributes
The type of the boxed class corresponding to primitive value type tp
.
The type of the boxed class corresponding to primitive value type tp
.
Attributes
Returns the erased type of the function class cls
Returns the erased type of the function class cls
- FunctionN for N > 22 becomes FunctionXXL
- FunctionN for 22 > N >= 0 remains as FunctionN
- ContextFunctionN for N > 22 becomes FunctionXXL
- ContextFunctionN for N <= 22 becomes FunctionN
- anything else becomes a NoType
Attributes
When typing a primitive value class or AnyVal, we ignore the getClass
member: it's supposed to be an override of the getClass
defined on Any
, but in dotty Any#getClass
is polymorphic so it ends up being an overload. This is especially problematic because it means that when writing:
When typing a primitive value class or AnyVal, we ignore the getClass
member: it's supposed to be an override of the getClass
defined on Any
, but in dotty Any#getClass
is polymorphic so it ends up being an overload. This is especially problematic because it means that when writing:
1.asInstanceOf[Int & AnyRef].getClass
the getClass
that returns Class[Int]
defined in Int can be selected, but this call is specified to return classOf[Integer]
, see tests/run/t5568.scala.
FIXME: remove all the getClass
methods defined in the standard library so we don't have to hot-patch it like this.
Attributes
A whitelist of Scala-2 classes that are known to be pure
A whitelist of Scala-2 classes that are known to be pure
Attributes
Is an context function class.
Is an context function class.
- ContextFunctionN for N >= 0
Attributes
Is tp
an context function type?
Is tp
an context function type?
Attributes
Is any function class where
Is any function class where
- FunctionXXL
- FunctionN for N >= 0
- ContextFunctionN for N >= 0
Attributes
Returns whether tp
is an instance or a refined instance of:
Returns whether tp
is an instance or a refined instance of:
- scala.FunctionN
- scala.ContextFunctionN
Attributes
Is a function class, or an impure function type alias
Is a function class, or an impure function type alias
Attributes
Returns whether tp
is an instance or a refined instance of:
Returns whether tp
is an instance or a refined instance of:
- scala.FunctionN
- scala.ContextFunctionN
- PolyFunction
Attributes
Is synthesized symbol with alphanumeric name allowed to be used as an infix operator?
Is synthesized symbol with alphanumeric name allowed to be used as an infix operator?
Attributes
Is tp
(an alias) of either a scala.FunctionN or a scala.ContextFunctionN instance?
Is tp
(an alias) of either a scala.FunctionN or a scala.ContextFunctionN instance?
Attributes
Is a function class where
Is a function class where
- FunctionN for N >= 0 and N != XXL
Attributes
If the Single Abstract Method of a Function class has this type, is it specializable?
If the Single Abstract Method of a Function class has this type, is it specializable?
Attributes
Is a synthetic function class
Is a synthetic function class
- FunctionN for N > 22
- ContextFunctionN for N >= 0
Attributes
Is this type a TupleN
type?
Is this type a TupleN
type?
Attributes
- Returns
-
true if the dealiased type of
tp
isTupleN[T1, T2, ..., Tn]
Is either FunctionXXL or a class that will be erased to FunctionXXL
Is either FunctionXXL or a class that will be erased to FunctionXXL
- FunctionXXL
- FunctionN for N >= 22
- ContextFunctionN for N >= 22
Attributes
If sym
is a patched library class, the source file of its patch class, otherwise NoSource
If sym
is a patched library class, the source file of its patch class, otherwise NoSource
Attributes
A finalizer that patches standard library classes. It copies all non-private, non-synthetic definitions from patchCls
to denot
while changing their owners to denot
. Before that it deletes any definitions of denot
that have the same name as one of the copied definitions.
A finalizer that patches standard library classes. It copies all non-private, non-synthetic definitions from patchCls
to denot
while changing their owners to denot
. Before that it deletes any definitions of denot
that have the same name as one of the copied definitions.
If an object is present in both the original class and the patch class, it is not overwritten. Instead its members are copied recursively.
To avpid running into cycles on bootstrap, patching happens only if patchCls
is read from a classfile.
Attributes
Lazy references to the root imports
Lazy references to the root imports
Attributes
Root types imported by default
Root types imported by default
Attributes
If cls
is a class in the scala package, its name, otherwise EmptyTypeName
If cls
is a class in the scala package, its name, otherwise EmptyTypeName
Attributes
If type ref
refers to a class in the scala package, its name, otherwise EmptyTypeName
If type ref
refers to a class in the scala package, its name, otherwise EmptyTypeName
Attributes
The JVM tag for tp
if it's a primitive, java.lang.Object
otherwise.
The JVM tag for tp
if it's a primitive, java.lang.Object
otherwise.
Attributes
Modules whose members are in the default namespace and their module classes
Modules whose members are in the default namespace and their module classes
Attributes
Concrete fields
Note: We cannot have same named methods defined in Object and Any (and AnyVal, for that matter) because after erasure the Any and AnyVal references get remapped to the Object methods which would result in a double binding assertion failure. Instead we do the following:
Note: We cannot have same named methods defined in Object and Any (and AnyVal, for that matter) because after erasure the Any and AnyVal references get remapped to the Object methods which would result in a double binding assertion failure. Instead we do the following:
- Have some methods exist only in Any, and remap them with the Erasure denotation transformer to be owned by Object.
- Have other methods exist only in Object. To achieve this, we synthesize all Any and Object methods; Object methods no longer get loaded from a classfile.
Attributes
def getClassA >: this.type: Class[? <: A]
A type alias of Object used to represent any reference to Object in a Java signature, the secret sauce is that subtype checking treats it specially:
A type alias of Object used to represent any reference to Object in a Java signature, the secret sauce is that subtype checking treats it specially:
tp <:< FromJavaObject
is equivalent to:
tp <:< Any
This is useful to avoid usability problems when interacting with Java code where Object is the top type. This is safe because this type will only appear in signatures of Java definitions in positions where Object
might appear, let's enumerate all possible cases this gives us:
-
At the top level:
// A.java void meth1(Object arg) {}
void meth2(T arg) {} // T implicitly extends Object // B.scala meth1(1) // OK meth2(1) // OK
This is safe even though Int is not a subtype of Object, because Erasure will detect the mismatch and box the value type.
-
In a class type parameter:
// A.java void meth3(scala.List