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-5934] Segmentation fault: 11 when creating a Set from an array of arrays #48493
Comments
It shouldn't crash, of course, but it's worth noting that the code isn't valid, since Arrays aren't Hashable. |
Intersesting, we somehow end up with no relationship between the constraint that the element type needs to be $T0 conforms to Hashable [[locator@0x10d8fa870 [Type@/Users/mark_lacey/Radar/sr5934.swift:2:11 -> opened generic]]];
disjunction [[locator@0x10d8fabc8 [Call@/Users/mark_lacey/Radar/sr5934.swift:2:11 -> apply function -> constructor member]]]:($T3) -> $T2 bound to decl Swift.(file).Set.init : <Element, Source where Element : Hashable, Element == Source.Element, Source : Sequence> (Set<Element>.Type) -> (Source) -> Set<Element> [[locator@0x10d8fabc8 [Call@/Users/mark_lacey/Radar/sr5934.swift:2:11 -> apply function -> constructor member]]]; or ($T3) -> $T2 bound to decl Swift.(file).SetAlgebra.init : <Self, S where Self : SetAlgebra, S : Sequence, Self.Element == S.Element> (Self.Type) -> (S) -> Self [[locator@0x10d8fabc8 [Call@/Users/mark_lacey/Radar/sr5934.swift:2:11 -> apply function -> constructor member]]];
([[String]]) arg tuple conv $T3 [[locator@0x10d8fab70 [Call@/Users/mark_lacey/Radar/sr5934.swift:2:11 -> apply argument]]]; |
@swift-ci create |
Here is a minimal repro:
|
Smaller repro:
In a build with asserts, we fail as follows:
I suspect we're failing to emit a diagnostic. |
Yeah, we're going into ConstraintSystem::salvage(), and then CSDiag doesn't diagnose anything. It's a bug in CSDiag, not in the solver, I think @rudkx. |
Environment
Apple Swift version 4.0 (swiftlang-900.0.63 clang-900.0.37)
Xcode Version 9.0 (9A235)
Additional Detail from JIRA
md5: 56b6fc636fc82460ce2539269a008d4d
duplicates:
is duplicated by:
relates to:
Issue Description:
Creating a set from an array of arrays, like this:
results in the following compiler crash:
The text was updated successfully, but these errors were encountered: