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
[ConstraintSystem] Handle ambiguities caused by requirement failures
Aggregate all requirement failures (regardless of kind) that belong
to the same locator and diagnose them as an ambiguity (if there is
more than one overload) or as the singular failure if all solutions
point to the same overload.
f1(A(),B()) // expected-error {{local function 'f1' requires that 'A' conform to 'Equatable'}}
1019
+
1020
+
func f2<T:P_56173, U:P_56173>(_:T, _:U){}
1021
+
// expected-note@-1 {{candidate requires that 'B' conform to 'P_56173' (requirement specified as 'U' : 'P_56173')}}
1022
+
func f2<T:Q_56173, U:Q_56173>(_:T, _:U){}
1023
+
// expected-note@-1 {{candidate requires that 'A' conform to 'Q_56173' (requirement specified as 'T' : 'Q_56173')}}
1024
+
1025
+
f2(A(),B()) // expected-error {{no exact matches in call to local function 'f2'}}
1026
+
1027
+
func f3<T:P_56173>(_:T)where T.Element ==Int{}
1028
+
// expected-note@-1 {{candidate requires that the types 'A.Element' (aka 'String') and 'Int' be equivalent (requirement specified as 'T.Element' == 'Int')}}
1029
+
func f3<U:Q_56173>(_:U)where U.Element ==String{}
1030
+
// expected-note@-1 {{candidate requires that 'A' conform to 'Q_56173' (requirement specified as 'U' : 'Q_56173')}}
1031
+
1032
+
f3(A()) // expected-error {{no exact matches in call to local function 'f3'}}
0 commit comments