Class IsFreshValueExpression

java.lang.Object
org.ek9lang.compiler.support.IsFreshValueExpression
All Implemented Interfaces:
Predicate<EK9Parser.ExpressionContext>

public final class IsFreshValueExpression extends Object implements Predicate<EK9Parser.ExpressionContext>
Predicate that returns true iff an expression evaluates to a fresh value — one that the caller does not retain an alias to. Used by the slice-1 inbound-encapsulation check (E08257) on MutexLock(...) constructor arguments.

Slice-1 conservative classification:

  • Literal — string, integer, boolean, etc. — always fresh.
  • Constructor call — a call whose resolved target is a constructor; the call creates a new instance, so the value is fresh.

Pipeline results and other "freshness-producing" expressions can be added as future refinements if real corpus surfaces friction. Anything else (bare identifier, field access, non-constructor method call) returns false.