mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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.
This commit is contained in:
@@ -144,9 +144,6 @@ func test17875634() {
|
||||
func test20770032() {
|
||||
if case let 1...10 = (1, 1) { // expected-warning{{'let' pattern has no effect; sub-pattern didn't bind any variables}} {{11-15=}}
|
||||
// expected-error@-1 {{expression pattern of type 'ClosedRange<Int>' cannot match values of type '(Int, Int)'}}
|
||||
// expected-error@-2 {{type '(Int, Int)' cannot conform to 'Equatable'}}
|
||||
// expected-note@-3 {{only concrete types such as structs, enums and classes can conform to protocols}}
|
||||
// expected-note@-4 {{required by operator function '~=' where 'T' = '(Int, Int)'}}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user