Class CompoundConditionOrError

All Implemented Interfaces:
Consumer<EK9Parser.ExpressionContext>

final class CompoundConditionOrError extends TypedSymbolAccess implements Consumer<EK9Parser.ExpressionContext>
Detects tautological and contradictory compound conditions using range algebra (E08086/E08087).

Analyses same-level compound expressions using and/or to detect:

  • AND subsumption: x > 10 and x > 5 — x > 5 is redundant (always true)
  • AND contradiction: x > 10 and x < 3 — impossible, always false
  • OR tautology: x > 5 or x <= 5 — covers entire domain, always true
  • OR subsumption: x > 5 or x > 10 — x > 10 is subsumed (redundant)

Only processes the root of an AND/OR chain to avoid duplicate errors on nested nodes.