Runtime: Fix runtime type resolution when mangled names refer to protocol extensions with Self same type constraints. #74997
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.
…ocol extensions with Self same type constraints.
If a type or opaque type descriptor appears inside of a protocol extension of the form:
then the runtime representation of the extension context was interpreted by the runtime demangler as a nominal type extension, even though the parameterization is on the
<Self>
generic signature of the protocol extension and not the generic signature of the nominal type. This would cause spurious rejection of mangled names referencing the extension context because we mistakenly thought that the type arguments mismatched with the nominal type signature rather than matching them to the extension context.Add some code to
_findExtendedTypeContextDescriptor
to detect when an extension is a protocol extension with aSelf == SameType
constraint, and pass the extension along rather than treating it as a nominal type extension. Fixes rdar://130168101.