Skip to content

Small availability checking fixes #34325

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 3 commits into from
Oct 16, 2020

Conversation

slavapestov
Copy link
Contributor

A handful of problems found by inspection.

// expected-error@-1 {{struct must be declared private because its generic requirement uses a private type}}
func nonGenericWhereClause() where T : PrivateProtocol {}
// expected-error@-1 {{instance method must be declared private because its generic requirement uses a private type}}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks a bunch, what an oversight!

Concrete types can conform to unavailable protocols because
the witness table for the conformance is not required for use
with the concrete type itself.

However, protocols cannot have unavailable base protocols.
I believe this was an oversight of the original implementation
here.
…ations

Access control, availability and exportability checking missed these
because of a baked-in assumption that getGenericParams() == nullptr
rules out the presence of a trailing where clause.
This was a no-op and it doesn't make sense in the current model.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov merged commit 38c8bbd into swiftlang:main Oct 16, 2020
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