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
Copy file name to clipboardExpand all lines: test/Sema/placeholder_type.swift
+18-18
Original file line number
Diff line number
Diff line change
@@ -147,15 +147,15 @@ let _ = [_].otherStaticMember.method()
147
147
func f(x:Any, arr:[Int]){
148
148
// FIXME: Better diagnostics here. Maybe we should suggest replacing placeholders with 'Any'?
149
149
150
-
if x is _{} // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without more context}}
151
-
if x is [_]{} // expected-error {{type of expression is ambiguous without more context}}
152
-
if x is ()->_{} // expected-error {{type of expression is ambiguous without more context}}
153
-
iflet y = x as?_{} // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without more context}}
154
-
iflet y = x as?[_]{} // expected-error {{type of expression is ambiguous without more context}}
155
-
iflet y = x as?()->_{} // expected-error {{type of expression is ambiguous without more context}}
156
-
lety1= x as!_ // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without more context}}
157
-
lety2= x as![_] // expected-error {{type of expression is ambiguous without more context}}
158
-
lety3= x as!()->_ // expected-error {{type of expression is ambiguous without more context}}
150
+
if x is _{} // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without a type annotation}}
151
+
if x is [_]{} // expected-error {{type of expression is ambiguous without a type annotation}}
152
+
if x is ()->_{} // expected-error {{type of expression is ambiguous without a type annotation}}
153
+
iflet y = x as?_{} // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without a type annotation}}
154
+
iflet y = x as?[_]{} // expected-error {{type of expression is ambiguous without a type annotation}}
155
+
iflet y = x as?()->_{} // expected-error {{type of expression is ambiguous without a type annotation}}
156
+
lety1= x as!_ // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without a type annotation}}
157
+
lety2= x as![_] // expected-error {{type of expression is ambiguous without a type annotation}}
158
+
lety3= x as!()->_ // expected-error {{type of expression is ambiguous without a type annotation}}
159
159
160
160
switch x {
161
161
case is _:break // expected-error {{type placeholder not allowed here}}
caselety as ()->_:break // expected-error {{type placeholder not allowed here}}
167
167
}
168
168
169
-
if arr is _{} // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without more context}}
170
-
if arr is [_]{} // expected-error {{type of expression is ambiguous without more context}}
171
-
if arr is ()->_{} // expected-error {{type of expression is ambiguous without more context}}
172
-
iflet y = arr as?_{} // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without more context}}
173
-
iflet y = arr as?[_]{} // expected-error {{type of expression is ambiguous without more context}}
174
-
iflet y = arr as?()->_{} // expected-error {{type of expression is ambiguous without more context}}
175
-
lety1= arr as!_ // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without more context}}
176
-
lety2= arr as![_] // expected-error {{type of expression is ambiguous without more context}}
177
-
lety3= arr as!()->_ // expected-error {{type of expression is ambiguous without more context}}
169
+
if arr is _{} // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without a type annotation}}
170
+
if arr is [_]{} // expected-error {{type of expression is ambiguous without a type annotation}}
171
+
if arr is ()->_{} // expected-error {{type of expression is ambiguous without a type annotation}}
172
+
iflet y = arr as?_{} // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without a type annotation}}
173
+
iflet y = arr as?[_]{} // expected-error {{type of expression is ambiguous without a type annotation}}
174
+
iflet y = arr as?()->_{} // expected-error {{type of expression is ambiguous without a type annotation}}
175
+
lety1= arr as!_ // expected-error {{type placeholder not allowed here}} expected-error {{type of expression is ambiguous without a type annotation}}
176
+
lety2= arr as![_] // expected-error {{type of expression is ambiguous without a type annotation}}
177
+
lety3= arr as!()->_ // expected-error {{type of expression is ambiguous without a type annotation}}
178
178
179
179
switch arr {
180
180
case is _:break // expected-error {{type placeholder not allowed here}}
Copy file name to clipboardExpand all lines: test/expr/closure/basic.swift
+1-1
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ func variadic() {
26
26
_ =f(1,2)
27
27
_ =f(1,3)
28
28
29
-
letD={(Ss ...)in1} // expected-error{{'...' cannot be applied to a subpattern which is not explicitly typed}}, expected-error{{unable to infer type of a closure parameter 'Ss' in the current context}}
29
+
letD={(Ss ...)in1} // expected-error{{'...' cannot be applied to a subpattern which is not explicitly typed}}, expected-error{{cannot infer type of closure parameter 'Ss' without a type annotation}}
30
30
}
31
31
32
32
// Closures with attributes in the parameter list.
0 commit comments