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
let _:Color=.Unknown("") // expected-error {{missing argument label 'description:' in call}} {{25-25=description: }}
436
441
let _:Color=.Unknown // expected-error {{member 'Unknown' expects argument of type '(description: String)'}}
437
442
let _:Color=.Unknown(42) // expected-error {{missing argument label 'description:' in call}}
443
+
// expected-error@-1 {{cannot convert value of type 'Int' to expected argument type 'String'}}
438
444
let _ :Color=.rainbow(42) // expected-error {{argument passed to call that takes no arguments}}
439
445
440
446
let _ :(Int,Float)=(42.0,12) // expected-error {{cannot convert value of type 'Double' to specified type 'Int'}}
@@ -446,6 +452,7 @@ let _: Color = .overload(1.0) // expected-error {{ambiguous reference to member
446
452
// expected-note @-1 {{overloads for 'overload' exist with these partially matching parameter lists: (a: Int), (b: Int)}}
447
453
let _:Color=.overload(1) // expected-error {{no exact matches in call to static method 'overload'}}
448
454
let _:Color=.frob(1.0,&i) // expected-error {{missing argument label 'b:' in call}}
455
+
// expected-error@-1 {{cannot convert value of type 'Double' to expected argument type 'Int'}}
449
456
let _:Color=.frob(1.0, b:&i) // expected-error {{cannot convert value of type 'Double' to expected argument type 'Int'}}
450
457
let _:Color=.frob(1, i) // expected-error {{missing argument label 'b:' in call}}
451
458
// expected-error@-1 {{passing value of type 'Int' to an inout parameter requires explicit '&'}}
@@ -711,9 +718,9 @@ func r24251022() {
711
718
vara=1
712
719
varb:UInt32=2
713
720
_ = a + b // expected-error {{binary operator '+' cannot be applied to operands of type 'Int' and 'UInt32'}} expected-note {{overloads for '+' exist with these partially matching parameter lists: (Int, Int), (UInt32, UInt32)}}
714
-
a += a + // expected-error {{binary operator '+' cannot be applied to operands of type 'Int' and 'UInt32'}} expected-note {{overloads for '+' exist with these partially matching parameter lists:}}
715
-
b
716
-
a += b // expected-error {{binary operator '+=' cannot be applied to operands of type 'Int' and 'UInt32'}} expected-note {{overloads for '+=' exist with these partially matching parameter lists: (inout Int, Int), (inout UInt32, UInt32)}}
721
+
a += a +
722
+
b // expected-error {{cannot convert value of type 'UInt32' to expected argument type 'Int'}}
723
+
a += b // expected-error {{cannot convert value of type 'UInt32' to expected argument type 'Int'}}
717
724
}
718
725
719
726
func overloadSetResultType(_ a :Int, b :Int)->Int{
read2(UnsafePointer(p), maxLength: MemoryLayout<T>.size) // expected-error {{cannot convert value of type 'UnsafePointer<Pointee>' to expected argument type 'UnsafeMutableRawPointer'}}
812
+
read2(UnsafePointer(p), maxLength: MemoryLayout<T>.size) // expected-error {{cannot convert value of type 'UnsafePointer<T>' to expected argument type 'UnsafeMutableRawPointer'}}
806
813
}
807
814
}
808
815
@@ -960,12 +967,10 @@ func SR_6272_a() {
960
967
case bar
961
968
}
962
969
963
-
// expected-error@+2 {{binary operator '*' cannot be applied to operands of type 'Int' and 'Float'}} {{35-35=Int(}} {{43-43=)}}
964
-
// expected-note@+1 {{expected an argument list of type '(Int, Int)'}}
970
+
// expected-error@+1 {{cannot convert value of type 'Float' to expected argument type 'Int'}} {{35-35=Int(}} {{43-43=)}}
965
971
let _:Int=Foo.bar.rawValue * Float(0)
966
972
967
-
// expected-error@+2 {{binary operator '*' cannot be applied to operands of type 'Int' and 'Float'}} {{18-18=Float(}} {{34-34=)}}
968
-
// expected-note@+1 {{expected an argument list of type '(Float, Float)'}}
973
+
// expected-error@+1 {{cannot convert value of type 'Int' to expected argument type 'Float'}} {{18-18=Float(}} {{34-34=)}}
969
974
let _:Float=Foo.bar.rawValue * Float(0)
970
975
971
976
// expected-error@+2 {{binary operator '*' cannot be applied to operands of type 'Int' and 'Float'}} {{none}}
@@ -977,12 +982,10 @@ func SR_6272_b() {
977
982
letlhs=Float(3)
978
983
letrhs=Int(0)
979
984
980
-
// expected-error@+2 {{binary operator '*' cannot be applied to operands of type 'Float' and 'Int'}} {{24-24=Float(}} {{27-27=)}}
981
-
// expected-note@+1 {{expected an argument list of type '(Float, Float)'}}
985
+
// expected-error@+1 {{cannot convert value of type 'Int' to expected argument type 'Float'}} {{24-24=Float(}} {{27-27=)}}
982
986
let _:Float= lhs * rhs
983
987
984
-
// expected-error@+2 {{binary operator '*' cannot be applied to operands of type 'Float' and 'Int'}} {{16-16=Int(}} {{19-19=)}}
985
-
// expected-note@+1 {{expected an argument list of type '(Int, Int)'}}
988
+
// expected-error@+1 {{cannot convert value of type 'Float' to expected argument type 'Int'}} {{16-16=Int(}} {{19-19=)}}
986
989
let _:Int= lhs * rhs
987
990
988
991
// expected-error@+2 {{binary operator '*' cannot be applied to operands of type 'Float' and 'Int'}} {{none}}
@@ -991,20 +994,18 @@ func SR_6272_b() {
991
994
}
992
995
993
996
func SR_6272_c(){
994
-
// expected-error@+2 {{binary operator '*' cannot be applied to operands of type 'Int' and 'String'}} {{none}}
995
-
// expected-note@+1 {{expected an argument list of type '(Int, Int)'}}
997
+
// expected-error@+1 {{cannot convert value of type 'String' to expected argument type 'Int'}} {{none}}
996
998
Int(3)*"0"
997
999
998
1000
structS{}
999
-
// expected-error@+2 {{binary operator '*' cannot be applied to operands of type 'Int' and 'S'}} {{none}}
1000
-
// expected-note@+1 {{expected an argument list of type '(Int, Int)'}}
1001
+
// expected-error@+1 {{cannot convert value of type 'S' to expected argument type 'Int'}} {{none}}
takesGenericDictionaryWithTypealias(true) // expected-error {{cannot convert value of type 'Bool' to expected argument type 'Dictionary<Key, Value>'}}
1257
-
func takesGenericFunction<T>(_ x:([T])->Void){}
1258
-
takesGenericFunction(true) // expected-error {{cannot convert value of type 'Bool' to expected argument type '(Array<_>) -> Void'}}
1259
-
func takesTuple<T>(_ x:([T],[T])){}
1260
-
takesTuple(true) // expected-error {{cannot convert value of type 'Bool' to expected argument type '(Array<_>, Array<_>)'}}
1254
+
func takesGenericDictionaryWithTypealias<T>(_ x:[T:Z]){} // expected-note {{in call to function 'takesGenericDictionaryWithTypealias'}}
1255
+
takesGenericDictionaryWithTypealias(true) // expected-error {{cannot convert value of type 'Bool' to expected argument type '[Any : Z]' (aka 'Dictionary<Any, Int>'}}
1256
+
// expected-error@-1 {{generic parameter 'T' could not be inferred}}
1257
+
func takesGenericFunction<T>(_ x:([T])->Void){} // expected-note {{in call to function 'takesGenericFunction'}}
1258
+
takesGenericFunction(true) // expected-error {{cannot convert value of type 'Bool' to expected argument type '([Any]) -> Void'}}
1259
+
// expected-error@-1 {{generic parameter 'T' could not be inferred}}
1260
+
func takesTuple<T>(_ x:([T],[T])){} // expected-note {{in call to function 'takesTuple'}}
1261
+
takesTuple(true) // expected-error {{cannot convert value of type 'Bool' to expected argument type '([Any], [Any])'}}
1262
+
// expected-error@-1 {{generic parameter 'T' could not be inferred}}
0 commit comments