Class TextLanguageDefinedOrError

java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.phase3.TextLanguageDefinedOrError
All Implemented Interfaces:
BiConsumer<ISymbol, EK9Parser.ParamExpressionContext>

final class TextLanguageDefinedOrError extends RuleSupport implements BiConsumer<ISymbol, EK9Parser.ParamExpressionContext>
A text made with a plain String literal naming a language that has no defines text for block is an error (E07157, Steve 2026-11-02).

Say("fr") is lowered to the base's generated _textFactory(lang), which compares the String EXACTLY with each block's language and, when none matches, returns an UNSET Say whose messages are unset Strings. For a language computed at run time that is right - the program asks with ? or falls back with Say(lang) ?: Say("en"). But a literal is known now: Say("de") with only "en", "fr" and "zh" blocks, or Report("en") with only an "en_GB" block (there is no fallback from a region to its language), can never be set. Both the assigned form and the chained form, Say("de").hello(), are calls, so both come here.

The languages are THE text's variants (TextVariantsOf), read across every file of the module. Only a plain "..." literal (PlainStringValue), perhaps in parentheses, is judged: a variable, a call or a backtick String is never this error.