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/diag_ambiguous_overloads.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -148,8 +148,8 @@ do {
148
148
}
149
149
}
150
150
do{
151
-
func f1(_ u:Int)->String{} // expected-note {{found this candidate}} expected-note {{candidate expects value of type 'Int' for parameter #1 (got 'Double')}}
152
-
func f1(_ u:String)->Double{} // expected-note {{found this candidate}} expected-note {{candidate expects value of type 'String' for parameter #1 (got 'Double')}}
151
+
func f1(_ u:Int)->String{} // expected-note 2 {{candidate expects value of type 'Int' for parameter #1 (got 'Double')}}
152
+
func f1(_ u:String)->Double{} // expected-note 2 {{candidate expects value of type 'String' for parameter #1 (got 'Double')}}
153
153
func f2(_ u:Int){}
154
154
155
155
f2(f1(1asDouble)) // expected-error {{no exact matches in call to local function 'f1'}}
// expected-error@-1 {{no exact matches in call to instance method 'joined'}}
752
-
// expected-note@-2 {{found candidate with type '(String) -> String'}}
753
752
// There is one more note here - candidate requires that 'Int' conform to 'Sequence' (requirement specified as 'Self.Element' : 'Sequence') pointing to Sequence extension
Copy file name to clipboardExpand all lines: test/expr/unary/keypath/keypath.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1067,8 +1067,8 @@ func f_56996() {
1067
1067
// https://github.com/apple/swift/issues/55805
1068
1068
// Key-path missing optional crashes compiler: Inactive constraints left over?
1069
1069
func f_55805(){
1070
-
let _:KeyPath<String?,Int?>= \.utf8.count // expected-error {{no exact matches in reference to property 'count'}}
1071
-
// expected-note@-1 {{found candidate with type 'Int'}}
1070
+
let _:KeyPath<String?,Int?>= \.utf8.count // expected-error {{value of optional type 'String.UTF8View?' must be unwrapped to refer to member 'count' of wrapped base type 'String.UTF8View'}}
1071
+
// expected-note@-1 {{chain the optional using '?' to access member 'count' only for non-'nil' base values}}
1072
1072
}
1073
1073
1074
1074
// rdar://74711236 - crash due to incorrect member access in key path
0 commit comments