Skip to content

Sema: Fix availability of inherited designated initializers, part 2 [4.2] #18037

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

  • Description: When a class inherits designated initializers from the superclass, we synthesize them. The superclass initializer might be less available than the superclass itself, so we have to inherit availability. We need to intersect this availability with all parent scopes of the subclass, to avoid a "declaration cannot be more available than its surrounding scope" error attached to an unknown source location.

  • Risk: Low, this adds the outer scope walk to the existing fix.

  • Tested: New test added.

  • Radar: rdar://problem/40853731

  • Reviewed by: @jrose-apple

We need to explicitly handle nested types here.

Fixes the (re-opened) <rdar://problem/40853731>,
<https://bugs.swift.org/browse/SR-7881>.
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@AnnaZaks
Copy link
Contributor

@swift-ci please nominate

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