[AST] Introduce GenericSignature::getConformanceAccessPath(). #7956
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce an API that determines the "conformance access path" that
one would follow to find the conformance of a given type parameter
(e.g.,
T.Iterator.Element
) to a given protocol (e.g.,Equatable
). Aconformance access path starts at one of the explicit requirements
of that generic signature and then proceeds through zero or more
protocol-supplied requirements. For example, given this function:
The conformance access path for
C.Iterator: IteratorProtocol
isbecause one starts with the explicit requirement
C: Collection
, goesto the inherited protocol requirement (the
Self
inCollection
conforms to
Sequence
) and then a requirement on the associated type(
Self.Iterator
inSequence
conforms toIteratorProtocol
).This is all scaffolding now; it's intended to be used by IRGen (to
find the witness tables it needs) and
SubstitutionMap
(to dig outconformances during substitution).