Class NonInferredTypeDefinition
- All Implemented Interfaces:
BiFunction<Workspace,
CompilerFlags, CompilationPhaseResult>
Goes through the now successfully parsed source files and uses a listener to do the second real pass at building the symbols - more explicit type symbol definitions.
The first pass 'SymbolDefinition' will have defined many symbols, types, functions. But the order may well have resulted in some explicit uses of generic types not being fully resolved in terms of the parameterization used. i.e. 'UseOfBuiltInGenerics4.ek9' shows a class being declared after it has been used in conjunctions with a generic/template type.
So this phase is designed to complete a second pass - but this time as all explicit types should be known (non-inferred use only). The resolver is configured to emit errors when explicit polymorphic parameterization fails.
NOTE, we are not trying to do the inferred 'polymorphic parameterization' like 'list ← List(2)'. We're only looking to do 'list as List of Integer' and list ← List() of Integer sorts of checks, but with developer created Template types and classes - which can appear in any order and in any file/module. Hence, the need for a second pass. We also need to start building type hierarchies as these are important for generic types and parameterised type use.
-
Field Summary
Fields inherited from class org.ek9lang.compiler.CompilerPhase
compilableProgramAccess, listener, reporter
-
Constructor Summary
ConstructorDescriptionNonInferredTypeDefinition
(boolean multiThread, SharedThreadContext<CompilableProgram> compilableProgramAccess, Consumer<CompilationEvent> listener, CompilerReporter reporter) Create a new phase 1 second pass template type symbol resolution definition instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
doApply
(Workspace workspace, CompilerFlags compilerFlags) Do the compilation phase.Methods inherited from class org.ek9lang.compiler.CompilerPhase
apply
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
-
Constructor Details
-
Method Details
-
doApply
Description copied from class:CompilerPhase
Do the compilation phase.- Specified by:
doApply
in classCompilerPhase
-