Class ExpressionIsBooleanResultOrError

All Implemented Interfaces:
BiConsumer<EK9Parser.ExpressionContext, String>

final class ExpressionIsBooleanResultOrError extends TypedSymbolAccess implements BiConsumer<EK9Parser.ExpressionContext, String>
Checks that an expression is a condition - a Boolean, or a type that promotes to one with '#^' (ControlIsBooleanOrError.isCondition(ISymbol, ISymbol), THE rule for every condition) - emitting ONLY_COMPATIBLE_WITH_BOOLEAN otherwise. Until front-end rationalisation D1 (2026-10-02) this demanded exactly Boolean while if/while accepted a promotable type. The statement word (for example 'assert' or 'require') is woven into the error message so the same check serves each boolean-result statement.

Tolerant of the developer's code being in error: if the expression has no recorded symbol or no resolved type yet (other errors will already have been emitted), nothing is reported here.