Class ControlIsBooleanOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.ControlIsBooleanOrError
- All Implemented Interfaces:
Consumer<EK9Parser.ExpressionContext>
final class ControlIsBooleanOrError
extends TypedSymbolAccess
implements Consumer<EK9Parser.ExpressionContext>
Checks that an expression used as a control (if/else if, while, do/while, a ternary) is a condition: a Boolean,
or a type that promotes to one with '#^'. If not emits an error.
IsCondition is THE rule for what a condition may be; assert and require hold one too
(ExpressionIsBooleanResultOrError). Phase 7 inserts the promotion (phase7.support.BooleanCondition).
Front-end rationalisation D1 (Steve, 2026-10-02): before it the controls accepted a promotable type and phase 7
never promoted it (a VerifyError at load), while assert and require demanded exactly Boolean.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionControlIsBooleanOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isAlreadyInError, isProcessingScopePure, isPureReassignmentDisallowed, recordATypedSymbol
-
Constructor Details
-
ControlIsBooleanOrError
ControlIsBooleanOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<EK9Parser.ExpressionContext>
-