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
Swift 5.1.3
Xcode 11.3.1
MacOS 10.14.6
md5: 2f1f35b69d7ff155d7ed2e7ec91fe52c
Issue Description:
The following code crashes the compiler (specifically, swift and SourceKitService both unexpectedly quit) in Xcode 11.3.1 running Swift 5.1.3:
swift
SourceKitService
protocol P { associatedtype A } enum E<A>: P {} struct S<G: P> where G.A: Numeric { typealias X = G.A init<T>(_ x: X) where G == E<T> {} } func foo() { S(1) }
Note that commenting out the last line (the foo() function) will let the rest of the code compile successfully.
foo()
The initializer call S(1) seems plausibly valid since Int does conform to Numeric.
S(1)
Int
Numeric
Furthermore, even if the type being initialized is fully specified as S<E<Int>>(1), it will still crash the compiler.
S<E<Int>>(1)
The text was updated successfully, but these errors were encountered:
Crash reproduces in Swift 5.2.2 but not the 2020-04-17 release of the S4TF toolchain, which has merged apple/swift:master in the past week.
Sorry, something went wrong.
@swift-ci create
This should be fixed in recent compilers. @NevinBR can you try with Xcode 11.5 beta 2 or a development snapshot at https://swift.org/download/#snapshots and confirm if this issue is fixed?
Comment by Daniel Sweeney (JIRA)
I just built this (the code snippet above) without a crash on the 05-04 Swift 5.3 toolchain and the 05-05 Swift Development toolchain.
It crashes the compiler and SourceKit on the Xcode 11.4.1 Toolchain though.
So it looks like this is OK in the development snapshots.
Thank you for everyone who confirmed this already, but I can add that the code snippet doesn't reproduce the crash in the Xcode 12 beta either.
Marking this as resolved. @NevinBR, please reopen it if you see this problem again.
No branches or pull requests
Environment
Swift 5.1.3
Xcode 11.3.1
MacOS 10.14.6
Additional Detail from JIRA
md5: 2f1f35b69d7ff155d7ed2e7ec91fe52c
Issue Description:
The following code crashes the compiler (specifically,
swift
andSourceKitService
both unexpectedly quit) in Xcode 11.3.1 running Swift 5.1.3:Note that commenting out the last line (the
foo()
function) will let the rest of the code compile successfully.The initializer call
S(1)
seems plausibly valid sinceInt
does conform toNumeric
.Furthermore, even if the type being initialized is fully specified as
S<E<Int>>(1)
, it will still crash the compiler.The text was updated successfully, but these errors were encountered: