This class creates symbols from definitions and imports and gives them lazy types.
During enter, trees are expanded as necessary, populating the expandedTree map. Symbols are created, and the symOfTree map is set up.
Symbol completion causes some trees to be already typechecked and typedTree entries are created to associate the typed trees with the untyped expanded originals.
During typer, original trees are first expanded using expandedTree. For each expanded member definition or import we extract and remove the corresponding symbol from the symOfTree map and complete it. We then consult the typedTree map to see whether a typed tree exists already. If yes, the typed tree is returned as result. Otherwise, we proceed with regular type checking.
The scheme is designed to allow sharing of nodes, as long as each duplicate appears in a different method.
The completer of a symbol defined by a member def or import (except ClassSymbols)
We are entering symbols coming from a SourceLoader
A map from method symbols to nested typers. Populated when methods are completed. Emptied when they are typechecked. The nested typer contains new versions of the four maps above including this one, so that trees that are shared between different DefDefs can be independently used as indices. It also contains a scope that contains nested parameters.
The scope of the typer. For nested typers this is a place parameters are entered during completion and where they survive until typechecking. A context with this typer also has this scope.
Add child annotation for
child to annotations of
cls. The annotation
is added at the correct insertion point, so that Child annotations appear
in reverse order of their start positions.
Add java enum constants
Enter and typecheck parameter list
Create package if it does not yet exist.
If this tree is a member def or an import, create a symbol of it and store in symOfTree map.
The type signature of a DefDef with given symbol
The enclosing class with given name; error if none exists
sym exists, enter it in effective scope. Check that
package members are not entered twice in the same run.
The expanded version of this tree, or tree itself if not expanded
Expand tree and create top-level symbols for statement and enter them into symbol table
Create top-level symbols for statements and enter them into symbol table
Create top-level symbols for all statements in the expansion of this statement and enter them into symbol table
For all class definitions
xstats: If the companion class if
not also defined in
xstats, invalidate it by setting its info to
Determines whether this field holds an enum constant. To qualify, the following conditions must be met: - The field's class has the ENUM flag set - The field's class extends java.lang.Enum - The field has the ENUM flag set - The field is static - The field is stable
Index symbols in
tree while asserting the
This will cause any old top-level symbol with the same fully qualified
name as a newly created symbol to be replaced.
The signature of a module valdef. This will compute the corresponding module class TypeRef immediately without going through the defined type of the ValDef. This is necessary to avoid cyclic references involving imports and module val defs.
sym as the symbol defined by
The symbol of the given expanded tree.
tree during completion using
typed, and remember result in TypedAhead map