superfluous_else
false positive when using if #available(…) else
to avoid deprecation warning
#5833
Closed
2 tasks done
Labels
bug
Unexpected and reproducible misbehavior.
good first issue
Issue to be taken up by new contributors yet unfamiliar with the project.
swift-compiler
An issue caused by a shortcoming in the Swift compiler.
New Issue Checklist
Bug Description
superfluous_else
outputs a false positive when usingif #available(…) else
to avoid deprecation warning:The
else
is necessary to avoid 2 deprecation warnings fromDispatchQueue.global(priority: .high).async {}
.That isn't my real use case; the deprecated function I use require arguments to be initialized & configured, so I just chose a very simple deprecated function at random as a much simpler example of the problem.
Presumably the same problem applies to
#unavailable
or other similar directives (i.e.if #<something> {} else {}
.Environment
The text was updated successfully, but these errors were encountered: