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
// <rdar://problem/19831919> Fixit offers as! conversions that are known to always fail
257
257
func rdar19831919(){
258
-
vars1=1+"str"; // expected-error{{binary operator '+' cannot be applied to operands of type 'Int' and 'String'}} expected-note{{overloads for '+' exist with these partially matching parameter lists: (String, String), (Int, UnsafeMutablePointer<Pointee>), (Int, UnsafePointer<Pointee>)}}
258
+
vars1=1+"str"; // expected-error{{binary operator '+' cannot be applied to operands of type 'Int' and 'String'}} expected-note{{overloads for '+' exist with these partially matching parameter lists: (Int, Int), (String, String), (Int, UnsafeMutablePointer<Pointee>), (Int, UnsafePointer<Pointee>)}}
259
259
}
260
260
261
261
// <rdar://problem/19831698> Incorrect 'as' fixits offered for invalid literal expressions
262
262
func rdar19831698(){
263
-
varv70=true+1 // expected-error{{binary operator '+' cannot be applied to operands of type 'Bool' and 'Int'}} expected-note {{overloads for '+' exist with these partially matching parameter lists: (UnsafeMutablePointer<Pointee>, Int), (UnsafePointer<Pointee>, Int)}}
263
+
varv70=true+1 // expected-error{{binary operator '+' cannot be applied to operands of type 'Bool' and 'Int'}} expected-note {{overloads for '+' exist with these partially matching parameter lists: (Int, Int), (UnsafeMutablePointer<Pointee>, Int), (UnsafePointer<Pointee>, Int)}}
264
264
varv71=true+1.0 // expected-error{{binary operator '+' cannot be applied to operands of type 'Bool' and 'Double'}}
265
265
// expected-note@-1{{overloads for '+'}}
266
266
varv72=true+true // expected-error{{binary operator '+' cannot be applied to two 'Bool' operands}}
read2(UnsafePointer(p), maxLength: MemoryLayout<T>.size) // expected-error {{cannot convert value of type 'UnsafePointer<_>' to expected argument type 'UnsafeMutableRawPointer'}}
@@ -921,10 +922,10 @@ let r29850459_a: Int = 0
921
922
letr29850459_b:Int=1
922
923
func r29850459()->Bool{returnfalse}
923
924
let _ =(r29850459_flag ? r29850459_a : r29850459_b)+42.0 // expected-error {{binary operator '+' cannot be applied to operands of type 'Int' and 'Double'}}
924
-
// expected-note@-1 {{overloads for '+' exist with these partially matching parameter lists: (Int, Int), (Double, Double), (Int, UnsafeMutablePointer<Pointee>), (Int, UnsafePointer<Pointee>)}}
925
+
// expected-note@-1 {{overloads for '+' exist with these partially matching parameter lists: (Double, Double), (Int, Int), (Int, UnsafeMutablePointer<Pointee>), (Int, UnsafePointer<Pointee>)}}
925
926
let _ =({true}()? r29850459_a : r29850459_b)+42.0 // expected-error {{binary operator '+' cannot be applied to operands of type 'Int' and 'Double'}}
926
-
// expected-note@-1 {{overloads for '+' exist with these partially matching parameter lists: (Int, Int), (Double, Double), (Int, UnsafeMutablePointer<Pointee>), (Int, UnsafePointer<Pointee>)}}
927
+
// expected-note@-1 {{overloads for '+' exist with these partially matching parameter lists: (Double, Double), (Int, Int), (Int, UnsafeMutablePointer<Pointee>), (Int, UnsafePointer<Pointee>)}}
927
928
let _ =(r29850459()? r29850459_a : r29850459_b)+42.0 // expected-error {{binary operator '+' cannot be applied to operands of type 'Int' and 'Double'}}
928
-
// expected-note@-1 {{overloads for '+' exist with these partially matching parameter lists: (Int, Int), (Double, Double), (Int, UnsafeMutablePointer<Pointee>), (Int, UnsafePointer<Pointee>)}}
929
+
// expected-note@-1 {{overloads for '+' exist with these partially matching parameter lists: (Double, Double), (Int, Int), (Int, UnsafeMutablePointer<Pointee>), (Int, UnsafePointer<Pointee>)}}
929
930
let _ =((r29850459_flag || r29850459())? r29850459_a : r29850459_b)+42.0 // expected-error {{binary operator '+' cannot be applied to operands of type 'Int' and 'Double'}}
930
-
// expected-note@-1 {{overloads for '+' exist with these partially matching parameter lists: (Int, Int), (Double, Double), (Int, UnsafeMutablePointer<Pointee>), (Int, UnsafePointer<Pointee>)}}
931
+
// expected-note@-1 {{overloads for '+' exist with these partially matching parameter lists: (Double, Double), (Int, Int), (Int, UnsafeMutablePointer<Pointee>), (Int, UnsafePointer<Pointee>)}}
Whatever.foo(a:23) // expected-error {{generic parameter 'A' could not be inferred}} expected-note {{explicitly specify the generic arguments to fix this issue}} {{9-9=<<#A: IntegerArithmetic#>, <#B: IntegerArithmetic#>>}}
234
+
Whatever.foo(a:23) // expected-error {{generic parameter 'A' could not be inferred}} expected-note {{explicitly specify the generic arguments to fix this issue}} {{9-9=<<#A: Arithmetic#>, <#B: Arithmetic#>>}}
235
235
236
236
// <rdar://problem/21718955> Swift useless error: cannot invoke 'foo' with no arguments
237
-
Whatever.bar() // expected-error {{generic parameter 'A' could not be inferred}} expected-note {{explicitly specify the generic arguments to fix this issue}} {{9-9=<<#A: IntegerArithmetic#>, <#B: IntegerArithmetic#>>}}
237
+
Whatever.bar() // expected-error {{generic parameter 'A' could not be inferred}} expected-note {{explicitly specify the generic arguments to fix this issue}} {{9-9=<<#A: Arithmetic#>, <#B: Arithmetic#>>}}
238
238
239
239
// <rdar://problem/27515965> Type checker doesn't enforce same-type constraint if associated type is Any
0 commit comments