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-10926] Abort trap with Error
and conditional conformance
#53317
Comments
Still crashing in Xcode 11b1 too! Something's being mangled incorrectly. @rjmccall, does this look familiar? |
Surprisingly, this wasn't actually about Error self-conformance; it was a much more general bug with function signatures that mention retroactive conditional conformances. #26019 |
Fixes landed in master and 5.1. |
jandamm (JIRA User), Could you verify if the problem is fixed and if so move the JIRA to "Closed"? Thanks! |
Comment by Jan Dammshäuser (JIRA) I tried with Xcode 11b5 and still got a crash. See lldb-rpc-server_2019-08-16-231847_jans-mbp.crash. Or do I have to download a Swift snapshot to test? |
@rjmccall, Could you check what is happening here? |
Comment by Jan Dammshäuser (JIRA) Today I got the time to test with the official Xcode 11.1 release and it is still crashing. |
Comment by Jan Dammshäuser (JIRA) Here is a small snippet that also produces the crash and has less noice around it: extension Array: Error where Element: Error {} |
@swift-ci create |
Works on master (I fixed the crash in |
The snippet wasn't enough to produce the crash for me, I had to actually use the extension Array: Error where Element: Error {}
enum Foo: Error { case bar }
func list<E>(_ errors: E...) -> Result<String, [E]> { .failure(errors) }
print(list([Foo.bar, Foo.bar])) // prints failure([[test.Foo.bar, test.Foo.bar]]) on master |
Suyash, should this be resolved, then? |
Yes, this should be marked as Resolved! |
Attachment: Download
Environment
I tested this code in a dynamic library (iOS) and in the Playground (iOS, macOS).
I'm using macOS 10.14.5
Xcode 10.2 (10E125)
Swift 5
Additional Detail from JIRA
md5: bb48ba104a046791cae92a8ebc115236
Issue Description:
Please checkout the attached Playground. There are two crashing examples and two working examples.
I get a compiler error when I have a type with two generic values (like `Result`) where one is constrained to `Error`.
Then I declare a function that takes in a `Result<A, B>` and returns a `Result<A, [B]>`.
And I also declared `Array: Error where Element: Error`.
In contrast I defined my own protocol and tried the same code but with `Array: Arb where Element: Arb` and everything works fine.
It also works until I try to call the function. Otherwise it also compiles fine (not in the Playground).
The text was updated successfully, but these errors were encountered: