Skip to content

Sema: Fix availability of inherited designated initializers [4.2] #17082

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

Inherited designated initializers got the same availability
as the corresponding initialier in the superclass.

However if the superclass was more available than the subclass,
we would generate a diagnostic that a member cannot be more
available than its containing type.

This diagnostic had an unknown source location, since the
location was for a synthesized declaration, causing confusion.

Fixes https://bugs.swift.org/browse/SR-7881 aka
rdar://problem/40853731.

Inherited designated initializers got the same availability
as the corresponding initialier in the superclass.

However if the superclass was more available than the subclass,
we would generate a diagnostic that a member cannot be more
available than its containing type.

This diagnostic had an unknown source location, since the
location was for a synthesized declaration, causing confusion.

Fixes <https://bugs.swift.org/browse/SR-7881> aka
<rdar://problem/40853731>.
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit 52ee4ff into swiftlang:swift-4.2-branch Jun 10, 2018
}

@available(OSX, introduced: 10.53)
class EsotericSmallBatchHipsterThing : WidelyAvailableBase {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing this! Can you add a test in the opposite direction, where the initializer is 10.53 and the subclass is 10.52? (I know that would break a lot of other things too, but we should have a test for it anyway.)

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