Skip to content

[AST] Keep generic type params generic in RequirementEnvironments. #14588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2018

Conversation

huonw
Copy link
Contributor

@huonw huonw commented Feb 13, 2018

Before this patch, the use of GenericSignature::getSubstitutionMap to
create a substitution map would result in some generic parameters being
completely elided (well, being mapped to concrete types causing a
->castTo() to crash). This patch changes that to
just do the reindexing of the type parameters directly, without trying
to be smart with more contextual information (i.e. τ_0_0 -> τ_1_0, even
if there's a τ_0_0 == Int requirement).

Fixes rdar://problem/37291254 and SR-6990.

Before this patch, the use of GenericSignature::getSubstitutionMap to
create a substitution map would result in some generic parameters being
completely elided (well, being mapped to concrete types causing a
->castTo<GenericTypeParamType>() to crash). This patch changes that to
just do the reindexing of the type parameters directly, without trying
to be smart with more contextual information (i.e. τ_0_0 -> τ_1_0, even
if there's a τ_0_0 == Int requirement).

Fixes rdar://problem/37291254 and SR-6990.
@huonw huonw requested a review from DougGregor February 13, 2018 11:59
@huonw
Copy link
Contributor Author

huonw commented Feb 13, 2018

Using the function subst directly here seems a bit weird?

@swift-ci Please smoke test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is cleaner. Thank you!

@huonw huonw merged commit f2c3870 into swiftlang:master Feb 13, 2018
@huonw huonw deleted the conditional-concrete-crash branch February 13, 2018 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants