You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
case.pan(letdata as GestureData), // expected-error {{matching a protocol value in multiple patterns is not yet supported; use separate cases instead}}
15
+
.pinch(letdata as GestureData):
16
+
print(data)
17
+
}
18
+
19
+
// This switch makes sure that we preserve the CFG so that dead code warnings do not show up. It also ensures that in at least two cases, we get one error per switch.
20
+
switch a {
21
+
case.pan(letdata as GestureData), // expected-error {{matching a protocol value in multiple patterns is not yet supported; use separate cases instead}}
22
+
.pinch(letdata as GestureData):
23
+
print(data)
24
+
}
25
+
}
26
+
27
+
func testGenericType<T, T2>(_ t :T, _ t2 :T2, _ a :Any, _ b :Any)->T?{
28
+
switch(a, b){
29
+
case(letx as T, _), // expected-error {{matching a generic value in multiple patterns is not yet supported; use separate cases instead}}
30
+
(_,letx as T):
31
+
return x
32
+
// This warning check is to ensure that we allow for warnings to be emitting in case blocks.
33
+
print("found it!") // expected-warning {{code after 'return' will never be executed}}
34
+
case(letx as T,lety as T2):
35
+
print(x)
36
+
print(y)
37
+
break
38
+
default:
39
+
returnnil
40
+
// This warning check is to ensure that we allow for warnings to be emitting in case blocks.
41
+
print("we failed = (") // expected-warning {{code after 'return' will never be executed}}
42
+
}
43
+
44
+
returnnil
45
+
print("we failed = (") // expected-warning {{code after 'return' will never be executed}}
0 commit comments