Class ContainerUnwrapObligations
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase5.SafeSymbolAccess
org.ek9lang.compiler.phase5.ContainerUnwrapObligations
Collects
CONTAINER_UNWRAP obligations from an object-access chain for the census — one per
Optional.get / Result.ok/error / Iterator.next call, discharged by
GUARD when the access is safe. Mirrors ObjectAccessExpressionValidOrError's recursive
chain walk (E08030), reusing the same SafeSymbolAccess predicates
(SafeSymbolAccess.requiresSafeAccess(ISymbol, String) for "is this an unwrap obligation", SafeSymbolAccess.isAccessUnSafe(ISymbol, String) for "is it
unguarded") so the census and the diagnostic never disagree on what an unwrap is or whether it is
guarded.
Ordering: runs immediately after ObjectAccessExpressionValidOrError on the same
enterObjectAccessExpression node, so the per-symbol "requires-safe-access" markers that
checker sets (via its SafeGenericAccessMarker) are already in place to be read here. In code
that compiles, every unwrap is guarded (an unguarded one is E08030), so all such obligations
discharge — the honest "guaranteed safe by guard" contribution to the roundel.
-
Field Summary
Fields inherited from class SafeSymbolAccess
safeGenericAccessMarker, safeGenericAccessPredicateFields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionContainerUnwrapObligations(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescription(package private) voidMethods inherited from class SafeSymbolAccess
isAccessUnSafe, requiresSafeAccessMethods inherited from class TypedSymbolAccess
getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
ContainerUnwrapObligations
ContainerUnwrapObligations(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
collectInto
-