Class DynamicConstructMonomorphisation
A dynamic construct inside Holder of type T is ONE symbol, recorded once against the generic's AST, and
typed with the template's T: its super (Transformer of T), its captured variables, its methods.
Scenario 3 generates the generic's bodies once per parameterisation by walking that same AST, so each
parameterisation needs ITS OWN class for the dynamic construct, typed with the concrete arguments - otherwise the
one class names Holder/T and the never-generated Transformer of T, and the program fails with
NoClassDefFoundError (found 2026-10-08 by the generic-omissions sweep, R5).
Outside a monomorphisation the construct is returned unchanged, so nothing outside a generic body moves. Inside one
the construct is cloned, renamed (its name plus the concrete type arguments, digested - deterministic and unique
per parameterisation) and re-typed through IRGenerationContext.resolveType(ISymbol): its super, traits,
captured variables and members (members via ClonedMemberRetyping, THE re-typing phase 6 uses too). The
copy is recorded on the context first, so every reference to the construct - in its own body, its constructor
call, a dynamic construct nested in it - resolves to the copy.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AggregateWithTraitsSymbolof(IRGenerationContext stackContext, AggregateWithTraitsSymbol dynamicClass) The dynamic class to generate and construct for the monomorphisation in progress.static FunctionSymbolof(IRGenerationContext stackContext, FunctionSymbol dynamicFunction) The dynamic function to generate and construct for the monomorphisation in progress.
-
Method Details
-
of
The dynamic function to generate and construct for the monomorphisation in progress. -
of
public static AggregateWithTraitsSymbol of(IRGenerationContext stackContext, AggregateWithTraitsSymbol dynamicClass) The dynamic class to generate and construct for the monomorphisation in progress.
-