[SR-6619] Unexpected error, bad fix-its with enum comparison #49168
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
type checker
Area → compiler: Semantic analysis
Environment
Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: df064141c8c7ed883594dd34703a74d5
Issue Description:
Since my enum cases have integer values, I would expect to be able to compare them this way. Instead, I get this confusing error:
If I turn the comparison condition into
then the first `s` becomes underlined in Xcode and it suggests a Fix-it of
I can kind of understand the `.rawValue` access, though I don't agree it should be required, but I don't understand the call to `Self`. The compiler doesn't either, it asks me if I wanted `self`, and of course that doesn't work either.
The text was updated successfully, but these errors were encountered: