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
[SR-5701] Segmentation fault with accidental generic parameter shadowing #48271
Comments
Another one of these:
The correct way to declare this method is
but of course it still shouldn't crash. @huonw, @slavapestov, does this look familiar? |
Thanks, that works! But why don't I need to specify the generic parameters? Because they are part of the type (Box) signature? |
Yep, that's correct. When you include the A and B in the method's generic parameters, you're shadowing the ones on the type, and then the type checker can't be sure if they're important or not. Diagnosing that is SR-1420. |
That makes sense, thanks for explanation! |
@belkadan I don't know what this problem is off the top of my head but usually this means type substitution produced an ErrorType at some point without emitting any diagnostics. |
@swift-ci create |
The following creduce-reduction seems to crash in the same way, but it doesn't involve shadowing:
|
I fixed this recently:
|
Attachment: Download
Environment
Apple Swift version 4.0 (swiftlang-900.0.59 clang-900.0.34.2)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: bbe3b12697dd02a5e2f200f05cc319db
relates to:
Issue Description:
I am not totally sure which part the actual problem is but I was able to reproduce a crash I have in my project in a sample swift file:
The declaration is not the problem, that works, it only crashes on usage. Here is the dump from this example:
I can also provide you access to the project, it's open source. But I guess the above example is enough.
The text was updated successfully, but these errors were encountered: