Package org.ek9lang.compiler.phase2
While there is focus on explicitly defined type usage, there is some simple inferred typing that is done for declared variables. This is very simple but useful in terms of properties and return variables.
NonInferredTypeDefinition
is the main entry point here and it
delegates through to ResolveDefineExplicitTypeListener
.
Again the SymbolsAndScopes
class is used to manage the scopes.
The Symbols and scopes that were defined in phase1 are now looked up up using the
SymbolsAndScopes
and in some cases augmented or in other cases checked.
Following the pass described above and second pass of the 'AST' is done using
TypeHierarchyChecks
. This is focussed on checking for loops in type hierarchies.
See org.ek9lang.compiler.phase3
for the next stage of compilation.
-
ClassDescriptionChecks HTTP Access for service operations because some require HTTP_SOURCE, but others do not support it.Examines all the service operations on a service and looks at the verbs used and the uri proto paths.Checks for duplicated trait names on an aggregate.Can be MULTI THREADED for developer source, but single threaded for bootstrapping.Checks that the variable supplied (if not null and has a type), does not have a type that is a genericTypeParameter.For Constrained Types, focus on checking it is possible to constrain the type and if so then clones the appropriate methods/operators over and alters the types as appropriate.Configures a dynamic class in terms of settings its super and configured traits.Configures the dynamic function with it's 'super', but also checks that the super can be used in the way the EK9 source code has been defined.Configures a function's 'super' in the most appropriate way.Configures the trait declaration and completes a number of checks on that trait once configured.Adds various synthetic methods to type defined by the EK9 developer.Checks for inferred declarations of variables in various contexts.Deals with variable only declarations.Processes a variable declaration - attempts to resolve the variable type.A bit of a long-winded name, but this is really the second pass of the second phase of compilation.The Generic T used in parametric types will exist but won't have any methods on yet.Checks for a type is resolved and is suitable genus and category.Checks for a type is resolved and is suitable to be extended from (in basic terms).Only types of a specific genus can be used as constraints on the generic type 'T'.Looks at the function and if it has no super function, attempts to work out what would be the best super function generic type it could implement.Some aggregates like classes, components, etc.SINGLE THREADED - Run across sources to check for types, functions and traits for 'super loops'.Checks operators from various contexts, typically this is delegated to other functions.Checks the PATH value (if this is a path parameter) and ensures that the name appears in the path itself on the operation.Check that a service operation complies with EK9 rules and return types etc.Does a simple check (excluding any inheritance) for visibility rules on methods/operators on aggregates.