We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ecc0ab commit 5239edfCopy full SHA for 5239edf
validation-test/compiler_crashers_2_fixed/0186-rdar46497155.swift
@@ -0,0 +1,32 @@
1
+// RUN: %target-typecheck-verify-swift
2
+
3
+protocol P {
4
+ func isEqual(_ other: P) -> Bool
5
+}
6
7
+struct A {
8
+ var value: P? = nil
9
10
11
+struct B {
12
+ func foo() throws -> A {}
13
14
15
+struct E {
16
+ func getB(_ flag: inout Bool) throws -> B {
17
+ return B()
18
+ }
19
20
21
+func foo(arr: [E], other: P) -> Bool {
22
+ return arr.compactMap { i in
23
+ // expected-error@-1 {{unable to infer complex closure return type; add explicit type to disambiguate}} {{29-29=-> B? }}
24
+ var flag = false
25
+ return try? i.getB(&flag)
26
+ }.compactMap { u -> P? in
27
+ guard let a = try? u.foo() else { return nil }
28
+ return a.value!
29
+ }.contains {
30
+ $0.isEqual(other)
31
32
0 commit comments