Class ConstantCoalescingOrError

All Implemented Interfaces:
Consumer<EK9Parser.ExpressionContext>

final class ConstantCoalescingOrError extends TypedSymbolAccess implements Consumer<EK9Parser.ExpressionContext>
Detects coalescing expressions whose result is predetermined (E08094).

Expressions like 5 <? 3 (always 3), "alpha" >? "beta" (always "beta"), or 1.0 <=? 2.0 (always 1.0) have predetermined results and indicate logic errors, dead code, or copy-paste mistakes. The comparison coalescing operators (<?, >?, <=?, >=?, ctx.coalescing_equality in the grammar) are checked for a literal on BOTH sides.

The Elvis ?: is checked for a literal on the LEFT (Steve, D5, 2026-10-07): a literal is always set, so 7 ?: fallback is always 7 and the right is never evaluated. ?? is deliberately not checked here (decision D2 is pending).