Skip to content

Generic type alias access level regression #16570

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

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented May 12, 2018

I noticed this while working on better checking of @usableForInline access control.

If a property had an inferred type that is a generic type alias, we weren't checking the access level of the generic arguments.

This used to work in 4.1 because we didn't have a sugared representation for generic type aliases, so we were checking the substituted underlying type here. But now that NameAliasType can store generic arguments, make sure we visit them here.

Fixes rdar://problem/40188409.

In Swift 3 mode, the canonical private DeclContext should
not look through extensions.

The only way I can reproduce this is with a missing warning
and we don't really care about missing warnings in Swift 3 mode.

However, the next patch in this PR regresses more things so
let's fix it properly.
If a property had an inferred type that is a generic type alias,
we weren't checking the access level of the generic arguments.

This used to work in 4.1 because we didn't have a sugared
representation for generic type aliases, so we were checking
the substituted underlying type here. But now that NameAliasType
can store generic arguments, make sure we visit them here.

Fixes <rdar://problem/40188409>.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@DougGregor assuming the tests pass are you OK with taking this into swift-4.2-branch and swift-4.2-branch-04-30-2018?

@AnnaZaks AnnaZaks requested a review from DougGregor May 12, 2018 21:01
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@slavapestov
Copy link
Contributor Author

The Linux failure was unrelated, see #16575. I’m kicking off another run of the tests.

@slavapestov slavapestov merged commit b6e637e into swiftlang:master May 12, 2018
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.

1 participant