Dotty Documentation

0.14.0-bin-SNAPSHOT

trait TypeAssigner
extends Object

[-] Constructors

[-] Members

[+] def accessibleSelectionType ( tree: RefTree , qual1: Tree ) ( implicit ctx: Context ) : Type

The type of the selection in tree, where qual1 is the typed qualifier part. The selection type is additionally checked for accessibility.

[+] def arrayToRepeated ( tree: Tree ) ( implicit ctx: Context ) : Tree
[+] def assertExists ( tp: Type ) : Type
[+] def assignType ( tree: Ident , tp: Type ) ( implicit ctx: Context ) : Ident

Type assignment method. Each method takes as parameters - an untpd.Tree to which it assigns a type, - typed child trees it needs to access to cpmpute that type, - any further information it needs to access to compute that type.

[+] def assignType ( tree: Select , qual: Tree ) ( implicit ctx: Context ) : Select
[+] def assignType ( tree: New , tpt: Tree ) ( implicit ctx: Context ) : New
[+] def assignType ( tree: Literal ) ( implicit ctx: Context ) : Literal
[+] def assignType ( tree: This ) ( implicit ctx: Context ) : This
[+] def assignType ( tree: Super , qual: Tree , inConstrCall: Boolean , mixinClass: Symbol ) ( implicit ctx: Context ) : Super
[+] def assignType ( tree: Apply , fn: Tree , args: List [ Tree ] ) ( implicit ctx: Context ) : Apply
[+] def assignType ( tree: TypeApply , fn: Tree , args: List [ Tree ] ) ( implicit ctx: Context ) : TypeApply
[+] def assignType ( tree: Typed , tpt: Tree ) ( implicit ctx: Context ) : Typed
[+] def assignType ( tree: NamedArg , arg: Tree ) ( implicit ctx: Context ) : NamedArg
[+] def assignType ( tree: Assign ) ( implicit ctx: Context ) : Assign
[+] def assignType ( tree: Block , stats: List [ Tree ] , expr: Tree ) ( implicit ctx: Context ) : Block
[+] def assignType ( tree: Inlined , bindings: List [ Tree ] , expansion: Tree ) ( implicit ctx: Context ) : Inlined
[+] def assignType ( tree: If , thenp: Tree , elsep: Tree ) ( implicit ctx: Context ) : If
[+] def assignType ( tree: Closure , meth: Tree , target: Tree ) ( implicit ctx: Context ) : Closure
[+] def assignType ( tree: CaseDef , pat: Tree , body: Tree ) ( implicit ctx: Context ) : CaseDef
[+] def assignType ( tree: Match , scrutinee: Tree , cases: List [ CaseDef ] ) ( implicit ctx: Context ) : Match
[+] def assignType ( tree: Labeled ) ( implicit ctx: Context ) : Labeled
[+] def assignType ( tree: Return ) ( implicit ctx: Context ) : Return
[+] def assignType ( tree: WhileDo ) ( implicit ctx: Context ) : WhileDo
[+] def assignType ( tree: Try , expr: Tree , cases: List [ CaseDef ] ) ( implicit ctx: Context ) : Try
[+] def assignType ( tree: SeqLiteral , elems: List [ Tree ] , elemtpt: Tree ) ( implicit ctx: Context ) : SeqLiteral
[+] def assignType ( tree: SingletonTypeTree , ref: Tree ) ( implicit ctx: Context ) : SingletonTypeTree
[+] def assignType ( tree: RefinedTypeTree , parent: Tree , refinements: List [ Tree ] , refineCls: ClassSymbol ) ( implicit ctx: Context ) : RefinedTypeTree

Assign type of RefinedType. Refinements are typed as if they were members of refinement class refineCls.

[+] def assignType ( tree: AppliedTypeTree , tycon: Tree , args: List [ Tree ] ) ( implicit ctx: Context ) : AppliedTypeTree
[+] def assignType ( tree: LambdaTypeTree , tparamDefs: List [ TypeDef ] , body: Tree ) ( implicit ctx: Context ) : LambdaTypeTree
[+] def assignType ( tree: MatchTypeTree , bound: Tree , scrutinee: Tree , cases: List [ CaseDef ] ) ( implicit ctx: Context ) : MatchTypeTree
[+] def assignType ( tree: ByNameTypeTree , result: Tree ) ( implicit ctx: Context ) : ByNameTypeTree
[+] def assignType ( tree: TypeBoundsTree , lo: Tree , hi: Tree ) ( implicit ctx: Context ) : TypeBoundsTree
[+] def assignType ( tree: Bind , sym: Symbol ) ( implicit ctx: Context ) : Bind
[+] def assignType ( tree: Alternative , trees: List [ Tree ] ) ( implicit ctx: Context ) : Alternative
[+] def assignType ( tree: UnApply , proto: Type ) ( implicit ctx: Context ) : UnApply
[+] def assignType ( tree: ValDef , sym: Symbol ) ( implicit ctx: Context ) : ValDef
[+] def assignType ( tree: DefDef , sym: Symbol ) ( implicit ctx: Context ) : DefDef
[+] def assignType ( tree: TypeDef , sym: Symbol ) ( implicit ctx: Context ) : TypeDef
[+] def assignType ( tree: Import , sym: Symbol ) ( implicit ctx: Context ) : Import
[+] def assignType ( tree: Annotated , arg: Tree , annot: Tree ) ( implicit ctx: Context ) : Annotated
[+] def assignType ( tree: PackageDef , pid: Tree ) ( implicit ctx: Context ) : PackageDef
[+] def assignType$default$4 : NoSymbol.type
[+] def avoid ( tp: Type , symsToAvoid: => List [ Symbol ] ) ( implicit ctx: Context ) : Type

An upper approximation of the given type tp that does not refer to any symbol in symsToAvoid. We need to approximate with ranges:

term references to symbols in symsToAvoid, term references that have a widened type of which some part refers to a symbol in symsToAvoid, type references to symbols in symsToAvoid, this types of classes in symsToAvoid.

Type variables that would be interpolated to a type that needs to be widened are replaced by the widened interpolation instance.

[+] def avoidPrivateLeaks ( sym: Symbol , pos: SourcePosition ) ( implicit ctx: Context ) : Type
[+] def avoidingType ( expr: Tree , bindings: List [ Tree ] ) ( implicit ctx: Context ) : Type
[+] def classBound ( info: ClassInfo ) ( implicit ctx: Context ) : Type

An abstraction of a class info, consisting of - the intersection of its parents, - refined by all non-private fields, methods, and type members, - abstracted over all type parameters (into a type lambda) - where all references to this of the class are closed over in a RecType.

[+] def ensureAccessible ( tpe: Type , superAccess: Boolean , pos: SourcePosition ) ( implicit ctx: Context ) : Type

If tpe is a named type, check that its denotation is accessible in the current context. Return the type with those alternatives as denotations which are accessible.

Also performs the following normalizations on the type tpe. (1) parameter accessors are always dereferenced. (2) if the owner of the denotation is a package object, it is assured that the package object shows up as the prefix.

[+] def qualifyingClass ( tree: Tree , qual: Name , packageOK: Boolean ) ( implicit ctx: Context ) : Symbol

The qualifying class of a this or super with prefix qual (which might be empty).

[+] final def reallyExists ( denot: Denotation ) ( implicit ctx: Context ) : Boolean

A denotation exists really if it exists and does not point to a stale symbol.

[+] def safeSubstParam ( tp: Type , pref: ParamRef , argType: Type ) ( implicit ctx: Context ) : Type

Substitute argument type argType for parameter pref in type tp, skolemizing the argument type if it is not stable and pref occurs in tp.

[+] def safeSubstParams ( tp: Type , params: List [ ParamRef ] , argTypes: List [ Type ] ) ( implicit ctx: Context ) : Type

Substitute types of all arguments args for corresponding params in tp. The number of parameters params may exceed the number of arguments. In this case, only the common prefix is substituted.

[+] def selectionType ( tree: RefTree , qual1: Tree ) ( implicit ctx: Context ) : Type

The type of the selection tree, where qual1 is the typed qualifier part.

[+] def seqToRepeated ( tree: Tree ) ( implicit ctx: Context ) : Tree
[+] private def toRepeated ( tree: Tree , from: ClassSymbol ) ( implicit ctx: Context ) : Tree