Class MonomorphizationScenarioDetector
java.lang.Object
org.ek9lang.compiler.phase7.MonomorphizationScenarioDetector
- All Implemented Interfaces:
Function<PossibleGenericSymbol, MonomorphizationScenarioDetector.Scenario>
public final class MonomorphizationScenarioDetector
extends Object
implements Function<PossibleGenericSymbol, MonomorphizationScenarioDetector.Scenario>
Detects which monomorphization scenario applies to a parameterized type.
There are three scenarios:
- PREBUILT - A Java class already exists for this exact parameterization (e.g., _Iterator_2648BF49... for Iterator of Integer). No generation needed. Detection: PRE_BUILT flag is set on the symbol during creation.
- EXTERN_DELEGATION - The generic type is Java-implemented (extern), but no pre-built class exists for this parameterization. Generate a delegation wrapper.
- USER_DEFINED_SOURCE - The generic type is defined in EK9 source. Generate from source with type substitution.
This approach is backend-agnostic (works for both JVM and LLVM backends) and supports third-party modules that provide pre-built parameterized types.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe three monomorphization scenarios. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
MonomorphizationScenarioDetector
public MonomorphizationScenarioDetector()
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<PossibleGenericSymbol, MonomorphizationScenarioDetector.Scenario>
-