IRGen: Workaround for type substitution limitation #76486
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.
If a constrained extension has fewer conformance requirements than the nominal type declaration, because some of the type parameters of the nominal type are fixed to concrete types by the extension, we would run into trouble because interface type substitution does not correctly handle this case.
Applying an identity substitution map to an interface type does not look up concrete types in the output generic signature, so we get back a type parameter that is not valid.
getReducedType() has a hack to deal with this. I'd like to get rid of the hack and fix interface type substitution to do this correctly, but until then, this will do.
Fixes #76479