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
[CS] A couple of minor improvements to operator diagnostics
- Simplify the fix locator when looking for a
fix already present in a pattern match, this
avoids us emitting both a diagnostic for the
argument conversion, and for a conformance failure.
- Include tuples in the diagnostic logic where
we emit a generic "operator cannot be applied"
diagnostic, as a conformance diagnostic is
unlikely to be helpful in that case.
// expected-error @+3 {{invalid character in source file}}
20
20
// expected-error @+2 {{expected ',' separator}}
21
-
// expected-error @+1 {{type '(Int, Int)' cannot conform to 'BinaryInteger'}}
21
+
// expected-error @+1 {{binary operator '==' cannot be applied to operands of type '(Int, Int)' and 'Int'}}
22
22
if(5 ‒ 5)==0{} // expected-note {{unicode character '‒' (Figure Dash) looks similar to '-' (Hyphen Minus); did you mean to use '-' (Hyphen Minus)?}} {{7-10=-}}
23
-
// expected-note @-1 {{operator function '=='}}
24
-
// expected-note @-2 {{only concrete types such as structs, enums and classes can conform to protocols}}
25
-
26
-
// FIXME(rdar://61028087): The above note should read "required by referencing operator function '==' on 'BinaryInteger' where 'Self' = '(Int, Int)'".
27
23
28
24
// GREEK QUESTION MARK (which looks like a semicolon)
0 commit comments