Skip to content
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

ClangImporter: Fix diagnostics for NS* prefix stripping from generic types #2702

Conversation

slavapestov
Copy link
Member

Radar: rdar://problem/26206263

…types

We were failing to create an unavailable TypeAlias for the old name
in the case the renamed type was generic, leading to poor diagnostics.

Also, Sema resolves generic TypeAliases very early, while building
a Type from a TypeRepr -- this means the unavailable/deprecated
check runs too late to catch generic TypeAlises.

Add a hack where we preserve a reference to the original TypeAliasDecl
by way of constructing a SubstitutedType which desugars to the
replacement type, rather than resolving the replacement type
directly, so that the availability check can pick it up.

A better fix for this would be to introduce a BoundGenericAliasType
sugared type, but that's a bigger change that can come later.

Fixes <rdar://problem/26206263>.
@slavapestov
Copy link
Member Author

@swift-ci Please test

@slavapestov
Copy link
Member Author

@DougGregor Can you please review?

@tkremenek
Copy link
Member

@swift-ci test linux

@tkremenek tkremenek merged commit 1ac2de4 into apple:swift-3.0-preview-1-branch May 25, 2016
@DougGregor
Copy link
Member

Weird use of SubstitutedType, but it makes perfect sense to do this for Swift 3 preview 1. Thanks!

@slavapestov slavapestov deleted the strip-ns-prefix-generic-type-3.0 branch May 27, 2016 06:02
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.

None yet

3 participants