Class MutexLockArgumentFreshnessOrError

All Implemented Interfaces:
BiConsumer<CallSymbol, EK9Parser.ParamExpressionContext>

final class MutexLockArgumentFreshnessOrError extends TypedSymbolAccess implements BiConsumer<CallSymbol, EK9Parser.ParamExpressionContext>
Inbound-encapsulation check on MutexLock(...) constructor calls.

The argument passed to a MutexLock(...) constructor becomes the lock's protected payload. If the caller retains a reference to that argument, the caller can mutate the payload outside the lock — bypassing enter() entirely. To close this loophole, the argument must be a fresh value:

  • A literal: MutexLock(0), MutexLock(""), MutexLock(true).
  • A constructor call: MutexLock(List() of Item), MutexLock(MyClass()).
  • An explicit copy via constructor: MutexLock(List(existing)).

Bare references to existing state (identifiers, field accesses, non-constructor call results) are rejected — the user adds Type(existing) at the construction site for an explicit copy.

Part of EK9's compile-time data-race detection (slice 1, model rule §2.6a). Error E08257 MUTEX_LOCK_ARG_NOT_FRESH.