[ConstraintSystem] Don't produce partially matching note if none of the overloads matched

This commit is contained in:
Pavel Yaskevich
2023-05-08 16:17:04 -07:00
committed by Pavel Yaskevich
parent 5f8e3eb6f6
commit 58ffca8f74
8 changed files with 26 additions and 11 deletions

View File

@@ -10,11 +10,8 @@ func test_UnicodeScalarDoesNotImplementArithmetic(_ us: UnicodeScalar, i: Int) {
isString(&a1)
// We don't check for the overload choices list on the overload note match because they may change on different platforms.
let a2 = "a" - "b" // expected-error {{binary operator '-' cannot be applied to two 'String' operands}}
// expected-note@-1 {{overloads for '-' exist with these partially matching parameter lists:}}
let a3 = "a" * "b" // expected-error {{binary operator '*' cannot be applied to two 'String' operands}}
// expected-note@-1 {{overloads for '*' exist with these partially matching parameter lists:}}
let a4 = "a" / "b" // expected-error {{binary operator '/' cannot be applied to two 'String' operands}}
// expected-note@-1 {{overloads for '/' exist with these partially matching parameter lists:}}
let b1 = us + us // expected-error {{binary operator '+' cannot be applied to two 'UnicodeScalar' (aka 'Unicode.Scalar') operands}}
let b2 = us - us // expected-error {{binary operator '-' cannot be applied to two 'UnicodeScalar' (aka 'Unicode.Scalar') operands}}