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-10551] Segfault 11 when compiling with certain protocol extensions & associatedtypes #52951
Comments
On Swift 5.1 (near-master):
|
@slavapestov, does this sound familiar? |
We should either reject that extension as invalid, or treat it like "extension D". |
@slavapestov I was thinking it would be better to reject it with a diagnostic that explains this could be simply written as "extension D" i.e. "extension of C with same-type constraint 'Self == D' is better expressed as extension of D". What do you think? If you feel this could be magically treated as "extension D" instead then what would be the best place to do this? In the GSB (i.e. when we call 'resolveConcreteConformance' maybe)? |
I think the decision to reject or accept this should be made independently of fixing the crash. These sorts of inconsistencies with generic signatures end up manifesting as real issues on valid code eventually. |
Hmm, interestingly we don't crash when the associatedtype in C is not present. |
No longer crashes. |
Environment
Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
Target: x86_64-apple-darwin18.5.0
MacOSX 10.14
Additional Detail from JIRA
md5: 698cf7a9d1278468ca3aa1d0a7c7cad9
is duplicated by:
extension where
constrained by equal operator withSelf
Issue Description:
If you try to compile the file below, it fails with a segmentation fault: 11. If the extension to C at the bottom is removed, then it successfully compiles, but not with it. Stack trace with Swift version pasted below `SegFault.swift`.
The text was updated successfully, but these errors were encountered: