Class ConstrainedConstructionOrError

All Implemented Interfaces:
Consumer<EK9Parser.CallContext>

final class ConstrainedConstructionOrError extends TypedSymbolAccess implements Consumer<EK9Parser.CallContext>
A constrained-type construction whose argument value is KNOWN at compile time and provably violates the constraint is an error (E08260), not a runtime Panic.

🔑 This runs inside PreIRListener's walk, and that placement IS the feature. The check previously had a walk of its own, so it could only ever see the token in front of it — which is why it was literal-only. Sharing PreIRListener's walk gives it the live ValueTrackingAnalyzer state, so a value that ARRIVES at the constructor is judged, however it got there: assigned from a literal, carried through branches, or narrowed by a path condition (if raw == UNDER_AGE narrows to a ConstantValue). The analyzer already models branch join, try/catch edges, loops, unreachable arms and unknown assignments, so none of that has to be re-derived here — an assignment the analyzer cannot evaluate becomes TOP and this check goes quiet, which is exactly the required behaviour.

Conservative by construction. An error is emitted ONLY when the value is provably violating. Anything else — TOP, an unrenderable constant kind, a base type outside the numeric set below, any reflective failure — yields no error and the existing runtime check stands. A FALSE POSITIVE rejects a valid program, which is worse than missing a bug, so every uncertainty resolves to silence.