Class RemovedCoalescingOperatorOrError
- All Implemented Interfaces:
Consumer<EK9Parser.ExpressionContext>
<=? and
>=? were removed. On equal values (<=> gives 0) <? and >? now give the LEFT operand,
which is what <=? and >=? gave, so each has a plain replacement: <? for <=? and
>? for >=?. (To get the RIGHT operand on a tie, swap the operands.)
The grammar keeps recognising the two tokens ONLY to give this error, as it keeps break and return
(E0107x); a program that uses one stops here, in phase 1, with a message that names the replacement.
E01096 (Steve, 2026-10-21) is the same for ??, the null coalescing operator: EK9 is designed so that no
value is absent, leaving it nothing to test, so x ?? y would give x (D75). It is reported at the
?? token, once per use.
??= (the null coalescing assignment, C#, JavaScript, PHP) is removed with it, under the same E01096: the
message names :=? (assign only if currently unset), the assignment that tests unset rather than absent.
It is reported by onAssignment(EK9Parser.AssignmentStatementContext) at the ??= token.
isRemoved(Token) is THE test for one of the four tokens: a phase-1 check that would report AT such a token for
another reason (E08269 reports a coalescing operand from the enclosing expression, before this one is entered)
leaves it to this error, so the first error at the place says what is wrong.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid(package private) static booleanisRemoved(org.antlr.v4.runtime.Token operator) Is this token one of the removed coalescing operators (<=?,>=?,??or??=)?(package private) voidThe assignment form:x ??= yreports E01096 at the??=, naming:=?.
-
Constructor Details
-
RemovedCoalescingOperatorOrError
RemovedCoalescingOperatorOrError(ErrorListener errorListener)
-
-
Method Details
-
isRemoved
static boolean isRemoved(org.antlr.v4.runtime.Token operator) Is this token one of the removed coalescing operators (<=?,>=?,??or??=)? -
onAssignment
The assignment form:x ??= yreports E01096 at the??=, naming:=?. Never auto-repaired:??=tests absence,:=?tests unset. -
accept
- Specified by:
acceptin interfaceConsumer<EK9Parser.ExpressionContext>
-