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
if true,{print("if-body")}elseiftrue,{print("else-if-body")}else{print("else-body")}
13
+
14
+
if true,{iftrue{{}}} // expected-error {{closure expression is unused}} expected-note {{did you mean to use a 'do' statement?}}
15
+
16
+
{ if true,{print(0)}} // expected-error {{closure expression is unused}} expected-note {{did you mean to use a 'do' statement?}}
17
+
18
+
( if true,{print(0)}) // expected-error {{'if' may only be used as expression in return, throw, or as the source of an assignment}} expected-error {{'if' must have an unconditional 'else' to be used as expression}}
19
+
20
+
if true,{true}(),{}
21
+
22
+
iftrue,{true},{print(0)} // expected-error {{function produces expected type 'Bool'; did you mean to call it with '()'?}}
23
+
24
+
if true,{print(0)}
25
+
{}()
26
+
27
+
if true,{true} // expected-error {{function produces expected type 'Bool'; did you mean to call it with '()'?}}
28
+
,{print(0)}
29
+
30
+
iftrue,{(x:()->Void)intrue}!=nil{print(0)} // expected-warning {{comparing non-optional value of type '(() -> Void) -> Bool' to 'nil' always returns true}}
31
+
32
+
iftrue,{(x:()->Void)intrue}
33
+
!=nil // expected-warning {{comparing non-optional value of type '(() -> Void) -> Bool' to 'nil' always returns true}}
34
+
{
35
+
print(0)
36
+
}
37
+
38
+
if{} // expected-error {{missing condition in 'if' statement}}
39
+
40
+
if ,{} // expected-error {{expected expression, var, or let in 'if' condition}}
41
+
42
+
guard else{return} // expected-error {{missing condition in 'guard' statement}}
43
+
44
+
guard ,else{return} // expected-error {{expected expression, var, let or case in 'guard' condition}}
45
+
46
+
guard true,else{return}
47
+
48
+
guard true,,else{return} // expected-error {{expected expression in conditional}}
49
+
50
+
guard true,{return} // expected-error {{expected 'else' after 'guard' condition}}
0 commit comments