Class ConceptualAccess
T, and the reading of it. Inside a generic body
T has only a placeholder's members, so every constructor, method or operator the body calls on it is marked,
and when a type argument is substituted (phase4/ParameterisedTypeOrError) it must have each marked member -
and, for a pure scope or a range, a pure one - or the parameterisation is an error (E07620, E10032) instead of IR
generation failing on a compile-clean program.
Three phase-3 places wrote the marks by hand and phase 4 read them raw (front-end rationalisation B-11): a call of
T() or a method (ResolveIdentifierReferenceCallOrError), an operator
(RequiredOperatorPresentOrError, and every route that resolves one) and a for range over T
(ForRangeOrError). They call note...; the reader asks isAccessed.... A comparison
coalescing operator on T marks T itself (noteCoalescingComparison(IAggregateSymbol), E07187).
An ordering of a type BUILT ON T - a comparator-less sort, a natural-order PriorityQueue,
<?, a range or a comparison over DictEntry of (K, Integer), OrderedBox of T - is recorded the
same way (noteOrderingUse(IAggregateSymbol, MethodSymbol, boolean), noteNaturalOrderQueue(ISymbol), on each T the type is built on) and
judged where the parameters are substituted (orderingUsesOf(List), phase4/ParameterisedTypeOrError),
with the verdict the same type gets when it is written directly (D71, D63). Phase 3 cannot judge it: the type's
<=> survives over the conceptual T and is withdrawn for some type arguments.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHow the generic's body asks a type built on its type parameters to order, which decides the verdict where the parameters are replaced: exactly the one the same type gets when it is written directly (phase 5'sRetractedComparatorUseOrError).static final recordOne ordering the generic's body asks of a type built on its type parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisAccessed(MethodSymbol member) True when the generic's body uses this member ofT.static booleanisAccessedByRange(MethodSymbol member) True when the member is the copy constructor of aforrange overT.static booleanisAccessedInPureScope(MethodSymbol member) True when the body used the member from a pure scope.static booleanTrue when the type is built on conceptual type parameters without being one: a parameterisation with a bareTamong its leaves (DictEntry of (K, Integer),List of (OrderedBox of T)), or a generic template named in its own body (this < otherinsideOrderedBox of type T, which isOrderedBox of T).static booleanisComparedByCoalescing(IAggregateSymbol conceptualT) True when the generic's body selects between values of this conceptualTwith a comparison coalescing operator.static voidnote(MethodSymbol member) Note that the generic's body uses this member of its conceptualT.static voidnote(MethodSymbol member, boolean inPureScope) Asnote(MethodSymbol), and when the body is in a pure scope remember that too: the concrete member must then be pure (a conceptual constructor's own purity is meaningless - it is synthetic onT).static voidnoteByRange(MethodSymbol copyConstructor, boolean inPureScope) Note the copy constructor aforrange overTwill use: which one runs, and whether it is pure, is only known at parameterisation.static voidnoteCoalescingComparison(IAggregateSymbol conceptualT) Note that the generic's body selects between values of its conceptualTwith<?or>?(D24 Q4 REVISED).static voidnoteIfConceptual(IAggregateSymbol owner, MethodSymbol operator) Note an operator the body used onowner, but only whenownerIS a conceptual type parameter - a concrete type needs no deferred check.static voidnoteNaturalOrderQueue(ISymbol elementType) Note a natural-orderPriorityQueueof this element type, when it is built on a conceptual parameter without being one (PriorityQueue of (OrderedBox of T)).static voidnoteOrderingUse(IAggregateSymbol owner, MethodSymbol operator, boolean writtenAsAnOperatorCall) Note, where a resolved ordering operator (<=><<=>>=) is used on a type that is built on a conceptual parameter without being one (DictEntry of (K, Integer)).static List<ConceptualAccess.OrderingUse> orderingUsesOf(List<? extends ISymbol> typeParameters) The orderings of types built on any of these conceptual parameters that the generic's body uses, each once (a type built on several parameters is recorded on each).static List<IAggregateSymbol> typeParametersUnder(ISymbol type) The conceptual parameters a (non-bare) parameterisation is built on, each once; for a generic template (named in its own body) its own type parameters.
-
Method Details
-
note
Note that the generic's body uses this member of its conceptualT. -
note
Asnote(MethodSymbol), and when the body is in a pure scope remember that too: the concrete member must then be pure (a conceptual constructor's own purity is meaningless - it is synthetic onT). -
noteByRange
Note the copy constructor aforrange overTwill use: which one runs, and whether it is pure, is only known at parameterisation. -
noteIfConceptual
Note an operator the body used onowner, but only whenownerIS a conceptual type parameter - a concrete type needs no deferred check. EVERY route that resolves an operator calls this: the operator expression (RequiredOperatorPresentOrError), a stream terminal's or tee's|(StreamAssemblyOrError) and a mutating or assignment operator such as:=:,:~:or+=(LhsAndRhsAssignmentOrError), sophase4/ParameterisedTypeOrErrorreports a parameterising type that lacks it (E07620). -
noteCoalescingComparison
Note that the generic's body selects between values of its conceptualTwith<?or>?(D24 Q4 REVISED). Whether that is allowed depends on the type argument - its values must not be of different run-time types whose<=>is unset (Sameness.mayMixRuntimeTypes(IAggregateSymbol, ISymbol)) - so it is judged whereTis substituted (E07187). The mark is onTitself, so a constrainedTis judged too. -
noteOrderingUse
public static void noteOrderingUse(IAggregateSymbol owner, MethodSymbol operator, boolean writtenAsAnOperatorCall) Note, where a resolved ordering operator (<=><<=>>=) is used on a type that is built on a conceptual parameter without being one (DictEntry of (K, Integer)). Every route that resolves an operator goes throughphase3/RequiredOperatorPresentOrError, which calls this: a comparator-lesssort,<?, a range (ConceptualAccess.OrderingKind.NEEDS_ORDERING) or an operator written as a call (ConceptualAccess.OrderingKind.OPERATOR_CALL, the route that records the call). A bareTisnoteIfConceptual(IAggregateSymbol, MethodSymbol)'s.- Parameters:
owner- the type the operator was resolved onoperator- the operatorwrittenAsAnOperatorCall- true when the use is an operator call the expression records (a binary operator or acase)
-
noteNaturalOrderQueue
Note a natural-orderPriorityQueueof this element type, when it is built on a conceptual parameter without being one (PriorityQueue of (OrderedBox of T)). A bareTelement takes the sort's own steps. -
isBuiltOnTypeParameters
True when the type is built on conceptual type parameters without being one: a parameterisation with a bareTamong its leaves (DictEntry of (K, Integer),List of (OrderedBox of T)), or a generic template named in its own body (this < otherinsideOrderedBox of type T, which isOrderedBox of T). -
typeParametersUnder
The conceptual parameters a (non-bare) parameterisation is built on, each once; for a generic template (named in its own body) its own type parameters. -
orderingUsesOf
public static List<ConceptualAccess.OrderingUse> orderingUsesOf(List<? extends ISymbol> typeParameters) The orderings of types built on any of these conceptual parameters that the generic's body uses, each once (a type built on several parameters is recorded on each). -
isComparedByCoalescing
True when the generic's body selects between values of this conceptualTwith a comparison coalescing operator. -
isAccessed
True when the generic's body uses this member ofT. -
isAccessedByRange
True when the member is the copy constructor of aforrange overT. -
isAccessedInPureScope
True when the body used the member from a pure scope.
-