Class MutexLockConstructionPositionOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.MutexLockConstructionPositionOrError
- All Implemented Interfaces:
Consumer<CallSymbol>
final class MutexLockConstructionPositionOrError
extends TypedSymbolAccess
implements Consumer<CallSymbol>
Restricts the construction of
MutexLock to field initialisers on classes or
components.
Conservative slice-1 rule: a MutexLock constructor call is permitted only when it is
NOT inside any enclosing method or free function. Field default initialisers naturally
have no enclosing executable scope, so the canonical
lockedX as MutexLock of T: MutexLock(...) pattern passes. Inside any method
body (including constructor bodies and dynamic functions), the call is rejected. The
constructor-body exemption documented in §3.5 of the model doc is deferred to slice 1.5
if real corpus needs it.
Part of EK9's compile-time data-race detection (slice 1, model rule §2.6).
Error E08256 MUTEX_LOCK_CONSTRUCTION_OUTSIDE_FIELD_INITIALISER.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionMutexLockConstructionPositionOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Methods inherited from class TypedSymbolAccess
getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
MutexLockConstructionPositionOrError
MutexLockConstructionPositionOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<CallSymbol>
-