mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Don't diagnose failures to call symmetrically-typed binary operators
as a failure to convert the individual operand, since the operator is likely conceptually generic in some way and the choice of any specific overload is probably arbitrary. Since we now fall back to a better-informed diagnostics point, take advantage of this to generate a specialized diagnostic when trying to compare values of function type with ===. Fixes rdar://25666129. This reverts commit073f427942, i.e. it reapplies35ba809fd0with a test fix to expect an extra note in one place.
This commit is contained in:
@@ -140,7 +140,7 @@ default: break
|
||||
|
||||
// <rdar://problem/21995744> QoI: Binary operator '~=' cannot be applied to operands of type 'String' and 'String?'
|
||||
switch ("foo" as String?) {
|
||||
case "what": break // expected-error{{value of optional type 'String?' not unwrapped; did you mean to use '!' or '?'?}}
|
||||
case "what": break // expected-error{{expression pattern of type 'String' cannot match values of type 'String?'}}
|
||||
default: break
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user