[SR-3198] Misleading compiler error when defining comparison operator with wrong return type #45786
Labels
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
improvement
Additional Detail from JIRA
md5: 7016a96416c4c42971331efed97ee627
duplicates:
Issue Description:
Tested on Xcode 8.1, Swift 3.0.1
When we implement custom comparison operator and either forgot to specify valid return type like this:
or specified wrong return type like this:
we got
Binary operator '==' cannot be applied to two 'Int' operands
instead of expected
'==' produces 'Bool', not the expected contextual result type 'DarwinBoolean'
.When I use usual function I got an expected compiler error.
The text was updated successfully, but these errors were encountered: