Class TextFactoryDispatch
text constructor call.
A TEXT base type (genus SymbolGenus.TEXT with no LANG squirrelled data) is
abstract: it must never be constructed directly. Instead the call is dispatched at runtime through a
synthesized static _textFactory(String) that returns the correct per-language variant (see
TextSubsystemAsmGenerator).
EVERY site that lowers a text constructor call MUST route through here — both a standalone/assigned
call (ConstructorCallProcessor) AND the start of an object-access chain
(ObjectAccessInstrGenerator, e.g. SomeText("en").message(...)). If the two paths
diverge they behave differently: the direct-construction path builds the abstract base instance,
which is set but carries no message-method bodies, so a chained message call silently
returns unset. That divergence was a real bug (inline text message calls returned blank). Call this
helper; do not re-derive the genus/LANG check.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<CallDetails> redirectForTextBase(IScope constructorParentScope, String typeName, List<String> parameterTypes, List<String> argumentVariables, CallMetaDataDetails metaData) IfconstructorParentScopeis a TEXT base type, return the static_textFactoryCallDetailsto emit (viaCallInstr.callStatic) instead of a direct constructor call; otherwiseOptional.empty()and the caller emits a normal constructor call.
-
Method Details
-
redirectForTextBase
public static Optional<CallDetails> redirectForTextBase(IScope constructorParentScope, String typeName, List<String> parameterTypes, List<String> argumentVariables, CallMetaDataDetails metaData) IfconstructorParentScopeis a TEXT base type, return the static_textFactoryCallDetailsto emit (viaCallInstr.callStatic) instead of a direct constructor call; otherwiseOptional.empty()and the caller emits a normal constructor call.- Parameters:
constructorParentScope- the parent scope of the resolved constructorMethodSymboltypeName- the fully-qualified (resolved) text base type nameparameterTypes- the constructor parameter types (the languageString)argumentVariables- the evaluated argument temporaries (the language value)metaData- the call metadata for the emitted call
-