Class MutexLockNotInGenericParameterOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.support.MutexLockNotInGenericParameterOrError
- All Implemented Interfaces:
Predicate<ParameterisedTypeData>
final class MutexLockNotInGenericParameterOrError
extends RuleSupport
implements Predicate<ParameterisedTypeData>
Rejects parameterising any generic (other than
MutexLock itself) with
MutexLock (or a parameterised MutexLock of T) as a type argument.
Identity tracking and the deadlock work (slice 2) depend on every lock having a stable
field-rooted home. Locks buried inside collections (List of MutexLock,
Optional of MutexLock, Dict of (K, MutexLock)) are unaddressable for
static analysis and reflect a misuse — the natural pattern is one MutexLock per
shared payload, held as a field.
Invoked from ResolverOrDefiner at parameterisation time, before the offending
parameterised type is created. Returns true when an error is emitted, matching
the convention of the other guard predicates on ResolverOrDefiner.
Model rule §2.1. Error E08254 MUTEX_LOCK_IN_GENERIC_PARAMETER.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionMutexLockNotInGenericParameterOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
-
Constructor Details
-
MutexLockNotInGenericParameterOrError
MutexLockNotInGenericParameterOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
test
- Specified by:
testin interfacePredicate<ParameterisedTypeData>- Returns:
trueiff an error was emitted (the parameterisation is invalid).
-