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-2544] Compiler crash on access to protocol function #45149
Comments
@benlangmuir, is it also worth getting this out of code completion until we actually implement support for it? |
@slavapestov, do you have the Radar that goes with this? |
If you want to ban this until it's fixed in SILGen, it should be done in the type-checker so users get a diagnostic (this code currently passes swiftc -parse). That should make code-completion do the right thing as well. |
Why would that make code completion do the right thing? |
@belkadan I'm just curious, how would you add support for that? what it would point to if there is no implementation (just definition) and what is the use case for that? the use I can think of is like this: class T: Test {
func foo() { }
}
let t = T()
Test.foo(t) // call T.foo |
That's how it would work: you'd have to pass a concrete instance with protocol type, and then it would dynamically call that on that instance. That's how it works for classes with overridable methods. |
Oh my mistake, we'd probably need to tweak a condition in |
Attachment: Download
Environment
Xcode 8 beta6
Additional Detail from JIRA
md5: 66a08045e4bc3b82814f31c480610389
duplicates:
Issue Description:
The code below is invalid and cause Signal 11 crash
Xcode is not helping here too (see attached screenshot), this suggestion should never happen as it's nothing that can be actually used.
The text was updated successfully, but these errors were encountered: