Skip to content

[Type checker] Teach areOverrideCompatibleSimple() to look at initializers #7788

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 1 commit into from
Feb 27, 2017

Conversation

DougGregor
Copy link
Member

Apply the same is-generic check to initializers that we apply to
functions when establishing basic override compatibility. This is a
simple optimization for master, but fixes a crasher for Swift 3.1.

Fixes SR-4059

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@jrose-apple
Copy link
Contributor

This seems incorrect; what if you have class IntList: ListBase<Int>?

…izers.

Apply the same is-generic check to initializers that we apply to
functions when establishing basic override compatibility. This is a
simple optimization for master, but fixes a crasher for Swift 3.1.

Fixes SR-4059.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

This is about the generic parameters on the initializer itself; it's not checking the generic parameters of the enclosing class.

You are correct that the implementation is wrong: one could override a concrete initializer with a generic one. But we need a bit more work to get there.

@DougGregor
Copy link
Member Author

Hmm. Maybe the name isGeneric() is misleading.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

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.

3 participants