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
we're comparing ev which is a non-optional❗ SelectorEventSet to .none. I meant to write ._none and the compiler didn't complain at all. .none is the one from Optional.none. So even though ev is non-optional so will never fall into the guardelse branch after being lifted to an optional, the Swift compiler lifts ev which is of type SelectorEventSet to Optional<SelectorEventSet>.some(ev) and then compares that to Optional<SelectorEventSet.none (which will never be the same).
Arguably the compiler should not do the optional promotion here because the other side is non-optional and should error. At the very least it should warn that my guard ev != .none doesn't make any sense because it can't hit the else branch.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Environment
Additional Detail from JIRA
md5: de349cbb62f36144fa9ce492b73e96f1
duplicates:
Issue Description:
Here's a Swift bug that was hiding a real SwiftNIO bug:
in the line
we're comparing
ev
which is a non-optional❗SelectorEventSet
to.none
. I meant to write._none
and the compiler didn't complain at all..none
is the one fromOptional.none
. So even thoughev
is non-optional so will never fall into theguard
else
branch after being lifted to an optional, the Swift compiler liftsev
which is of typeSelectorEventSet
toOptional<SelectorEventSet>.some(ev)
and then compares that toOptional<SelectorEventSet.none
(which will never be the same).Arguably the compiler should not do the optional promotion here because the other side is non-optional and should error. At the very least it should warn that my
guard ev != .none
doesn't make any sense because it can't hit theelse
branch.The text was updated successfully, but these errors were encountered: