[6.0][IRGen] Strip marker protocols in a few more places #74138
Merged
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.
Cherry-pick of #74130
Explanation:
Fixes a recent regression that leads on an infinite recursion in metadata accessors for generic types and improves handling of protocol compositions that have only marker protocols.
Strip marker protocols when forming generic metadata requests
Without this might might end up with a single element protocol compositions
which are invalid.
Move marker protocol stripping from
mangleTypeSymbol
tomangleTypeForFlatUniqueTypeRef
The original check introduced by [AST] Special handling for existentials with superclass and marker pr… #71855
is too broad. For concrete metadata we call the runtime demangler so
we need to strip off marker protocols when mangling that string and
mangleTypeForReflection
already does that.Scope: Generic metadata accessors
Main Branch PR: [IRGen] Strip marker protocols in a few more places #74130
Resolves: rdar://128667580
Risk: Low
Reviewed By: @slavapestov
Testing: Added new tests to the test suite.