A type carrying some annotations.
A class remembering a type instantiation for some a set of overloaded polymorphic symbols.
Precondition: zipped params/args nonEmpty.
A map to compute the asSeenFrom method
BoundedWildcardTypes, used only during type inference, are created in two places that I can find:
A class representing a class info
A common base class for intersection types and class types
A class representing a constant type.
A map to implement the contains
method.
A map to implement the contains
method.
A binder defining data associated with De Bruijn indices.
A De Bruijn index referring to a previous type argument.
Used by existentialAbstraction.
A map to implement the filter
method.
A map to implement the filter
method.
Precondition: params.
A class representing an as-yet unevaluated type.
A throwable signalling a malformed type
A class representing a method type with parameters.
A class representing types with a name.
A class containing the alternatives and type prefix of an overloaded symbol.
A type function or the type of a polymorphic value (and thus of kind *).
An exception for cyclic references from which we can recover
A class representing intersection types with refinements of the form
<parents_0> with ... with <parents_n> { decls }
Cannot be created directly;
one should always use refinedType
for creation.
A proxy for a type (identified by field underlying
) that forwards most
operations to it.
A proxy for a type (identified by field underlying
) that forwards most
operations to it (for exceptions, see WrappingProxy, which forwards even more operations).
A class for singleton types of the form <prefix>.<sym.name>.type
.
A base class for types that represent a single value (single-types and this-types).
A base class for types that defer some operations to their immediate supertype.
A base class to compute all substitutions
A map to implement the substSym
method.
A map to implement the substThis
method.
A map to implement the subst
method.
A class for this-types of the form <sym>.
The base class for all types
A class for the bounds of abstract types and type parameters
A class expressing upper and lower bounds constraints of type variables, as well as their instantiations.
A throwable signalling a type error
A prototype for mapping a function over all possible types
A class for named types of the form
<prefix>.<sym.name>[args]
Cannot be created directly; one should always use typeRef
for creation.
A class representing a type variable: not used after phase typer
.
A map to implement the contains
method.
An object representing an erroneous type
The canonical creator for implicit method types
The canonical creator for implicit method types
An object representing a non-existing prefix
An object representing a non-existing type
An object representing an unknown type, used during type inference.
Type with all top-level occurrences of abstract types replaced by their bounds
Type with all top-level occurrences of abstract types replaced by their bounds
Make symbol sym
a member of scope tp.decls
where thistp
is the narrowed owner type of the scope.
Make symbol sym
a member of scope tp.decls
where thistp
is the narrowed owner type of the scope.
Creator for AnnotatedTypes.
Creator for AnnotatedTypes. It returns the underlying type if annotations.isEmpty rather than walking into the assertion.
A creator for type applications
A creator for type applications
A creator for existential types where the type arguments, rather than being applied directly, are interpreted as the upper bounds of unknown types.
A creator for existential types where the type arguments, rather than being applied directly, are interpreted as the upper bounds of unknown types. For instance if the type argument list given is List(AnyRefClass), the resulting type would be e.g. Set[_ <: AnyRef] rather than Set[AnyRef] .
Does this type have a prefix that begins with a type variable, or is it a refinement type? For type prefixes that fulfil this condition, type selections with the same name of equal (wrt) =:= prefixes are considered equal wrt =:=
Does this type have a prefix that begins with a type variable, or is it a refinement type? For type prefixes that fulfil this condition, type selections with the same name of equal (wrt) =:= prefixes are considered equal wrt =:=
Create a new MethodType of the same class as tp, i.
Create a new MethodType of the same class as tp, i.e. keep JavaMethodType
Remove any occurrences of type aliases from this type
Substitutes the empty scope for any non-empty decls in the type.
Remove any occurrence of type <singleton> from this type and its parents
A creator for existential types.
A creator for existential types. This generates:
tpe1 where { tparams }
where tpe1
is the result of extrapolating tpe
wrt to tparams
.
Extrapolating means that type variables in tparams
occurring
in covariant positions are replaced by upper bounds, (minus any
SingletonClass markers), type variables in tparams
occurring in
contravariant positions are replaced by upper bounds, provided the
resulting type is legal wrt to stability, and does not contain any type
variable in tparams
.
The abstraction drops all type parameters that are not directly or
indirectly referenced by type tpe1
. If there are no remaining type
parameters, simply returns result type tpe
.
Perform operation p
on arguments tp1
, arg2
and print trace of computation.
Perform operation p
on arguments tp1
, arg2
and print trace of computation.
If option explaintypes
is set, print a subtype trace for op(found, required)
.
If option explaintypes
is set, print a subtype trace for op(found, required)
.
If option explaintypes
is set, print a subtype trace for found <:< required
.
If option explaintypes
is set, print a subtype trace for found <:< required
.
From a list of types, find any which take type parameters where the type parameter bounds contain references to other any types in the list (including itself.
From a list of types, find any which take type parameters where the type parameter bounds contain references to other any types in the list (including itself.)
List of symbol pairs holding the recursive type parameter and the parameter which references it.
The greatest lower bound wrt <:< of a list of types
The greatest lower bound wrt <:< of a list of types
The greatest lower bound wrt <:< of a list of types, which have been normalized wrt elimSuper
The greatest lower bound wrt <:< of a list of types, which have been normalized wrt elimSuper
Again avoiding calling length, but the lengthCompare interface is clunky.
Again avoiding calling length, but the lengthCompare interface is clunky.
A creator for intersection type where intersections of a single type are replaced by the type itself.
A creator for intersection type where intersections of a single type are replaced by the type itself.
A creator for intersection type where intersections of a single type are replaced by the type itself, and repeated parent classes are merged.
A creator for intersection type where intersections of a single type are replaced by the type itself, and repeated parent classes are merged.
!!! Repeated parent classes are not merged - is this a bug in the comment or in the code?
A map from lists to compound types that have the given list as parents.
A map from lists to compound types that have the given list as parents. This is used to avoid duplication in the computation of base type sequences and baseClasses. It makes use of the fact that these two operations depend only on the parents, not on the refinement.
The isNumericValueType tests appear redundant, but without them test/continuations-neg/function3.
The isNumericValueType tests appear redundant, but without them test/continuations-neg/function3.scala goes into an infinite loop. (Even if the calls are to typeSymbolDirect.)
Is intersection of given types populated? That is, for all types tp1, tp2 in intersection for all common base classes bc of tp1 and tp2 let bt1, bt2 be the base types of tp1, tp2 relative to class bc Then: bt1 and bt2 have the same prefix, and any corresponding non-variant type arguments of bt1 and bt2 are the same
Is intersection of given types populated? That is, for all types tp1, tp2 in intersection for all common base classes bc of tp1 and tp2 let bt1, bt2 be the base types of tp1, tp2 relative to class bc Then: bt1 and bt2 have the same prefix, and any corresponding non-variant type arguments of bt1 and bt2 are the same
Is type tp a raw type?
Is type tp a raw type?
Do tp1
and tp2
denote equivalent types?
Do tp1
and tp2
denote equivalent types?
Are tps1
and tps2
lists of pairwise equivalent types?
Are tps1
and tps2
lists of pairwise equivalent types?
Are tps1
and tps2
lists of equal length such that all elements
of tps1
conform to corresponding elements of tps2
?
Are tps1
and tps2
lists of equal length such that all elements
of tps1
conform to corresponding elements of tps2
?
Do type arguments targs
conform to formal parameters tparams
?
Do type arguments targs
conform to formal parameters tparams
?
The maximum allowable depth of lubs or glbs over types ts
.
The maximum allowable depth of lubs or glbs over types ts
.
This is the maximum depth of all types in the base type sequences
of each of the types ts
, plus LubGlbMargin.
like map2, but returns list xs
itself - instead of a copy - if function
f
maps all elements to themselves.
like map2, but returns list xs
itself - instead of a copy - if function
f
maps all elements to themselves.
A function implementing tp1
matches tp2
.
A function implementing tp1
matches tp2
.
The maximum number of recursions allowed in toString
The maximum number of recursions allowed in toString
Compute lub (if variance == 1
) or glb (if variance == -1
) of given list
of types tps
.
Compute lub (if variance == 1
) or glb (if variance == -1
) of given list
of types tps
. All types in tps
are typerefs or singletypes
with the same symbol.
Return Some(x)
if the computation succeeds with result x
.
Return None
if the computation fails.
Does a pattern of type patType
need an outer test when executed against
selector type selType
in context defined by currentOwner
?
Does a pattern of type patType
need an outer test when executed against
selector type selType
in context defined by currentOwner
?
A creator for existential types which flattens nested existentials.
A creator for existential types which flattens nested existentials.
A creator for type parameterizations that strips empty type parameter lists.
A creator for type parameterizations that strips empty type parameter lists. Use this factory method to indicate the type has kind * (it's a polymorphic value) until we start tracking explicit kinds equivalent to typeFun (except that the latter requires tparams nonEmpty).
PP to AM: I've co-opted this for where I know tparams may well be empty, and
expecting to get back tpe
in such cases. Re being "forgiving" below,
can we instead say this is the canonical creator for polyTypes which
may or may not be poly? (It filched the standard "canonical creator" name.)
The raw to existential map converts a raw type to an existential type.
The raw to existential map converts a raw type to an existential type. It is necessary because we might have read a raw type of a parameterized Java class from a class file. At the time we read the type the corresponding class file might still not be read, so we do not know what the type parameters of the type are. Therefore the conversion of raw types to existential types might not have taken place in ClassFileparser.sigToType (where it is usually done).
The canonical creator for a refined type with an initially empty scope.
The canonical creator for a refined type with an initially empty scope.
...
...
...
the canonical creator for a refined type with a given scope
the canonical creator for a refined type with a given scope
Repack existential types, otherwise they sometimes get unpacked in the wrong location (type inference comes up with an unexpected skolem)
Repack existential types, otherwise they sometimes get unpacked in the wrong location (type inference comes up with an unexpected skolem)
True if two lists have the same length.
True if two lists have the same length. Since calling length on linear sequences is O(n), it is an inadvisable way to test length equality.
The canonical creator for single-types
The canonical creator for single-types
The current skolemization level, needed for the algorithms in isSameType, isSubType that do constraint solving under a prefix.
The current skolemization level, needed for the algorithms in isSameType, isSubType that do constraint solving under a prefix.
Solve constraint collected in types tvars
.
Solve constraint collected in types tvars
.
All type variables to be instantiated.
The type parameters corresponding to tvars
The variances of type parameters; need to reverse solution direction for all contravariant variables.
When true
search for max solution else min.
A minimal type list which has a given list of types as its base type sequence
A minimal type list which has a given list of types as its base type sequence
Does type tp
implement symbol sym
with same or
stronger type? Exact only if sym
is a member of some
refinement type, otherwise we might return false negatives.
Does type tp
implement symbol sym
with same or
stronger type? Exact only if sym
is a member of some
refinement type, otherwise we might return false negatives.
Make each type var in this type use its original type for comparisons instead of collecting constraints.
Make each type var in this type use its original type for comparisons instead of collecting constraints.
A creator for a type functions, assuming the type parameters tps already have the right owner.
A creator for a type functions, assuming the type parameters tps already have the right owner.
A creator for anonymous type functions, where the symbol for the type function still needs to be created.
A creator for anonymous type functions, where the symbol for the type function still needs to be created.
TODO: type params of anonymous type functions, which currently can only arise from normalising type aliases, are owned by the type alias of which they are the eta-expansion higher-order subtyping expects eta-expansion of type constructors that arise from a class; here, the type params are owned by that class, but is that the right thing to do?
A collector that tests for existential types appearing at given variance in a type
A collector that tests for existential types appearing at given variance in a type
The canonical creator for typerefs todo: see how we can clean this up a bit
The canonical creator for typerefs todo: see how we can clean this up a bit
A map to convert every occurrence of a type variable to a wildcard type.
A list of the typevars in a type.
A list of the typevars in a type.
A log of type variable with their original constraints.
A log of type variable with their original constraints. Used in order to undo constraints in the case of isSubType/isSameType failure.
Overridden in reflection compiler
Overridden in reflection compiler
A map to convert every occurrence of a wildcard type to a fresh type variable
Execute op
while printing a trace of the operations on types executed.
Execute op
while printing a trace of the operations on types executed.
This trait overrides methods in reflect.internal, bracketing them in synchronized { ... } to make them thread-safe