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
swift-ci opened this issue
Jul 15, 2019
· 1 comment
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselffeatureA feature request or implementation
Swift doesn't do arbitrary type refinement like this, at least partially because it only works for immutable names. If you're working with a local variable, mutable class instance property, or mutable global, you wouldn't be able to rely on that refinement. Use if let here instead.
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselffeatureA feature request or implementation
Environment
Swift 5, xCode 11.0 beta 3 (11M362v)
Additional Detail from JIRA
md5: 205361b48a935095ef57dba1655e44b7
Issue Description:
When writing something like:
The
error
in the else, is assumed to be nil for the compiler and it gives me this warning:Well, if I've checked that error is nil in the guard body, the else means that
error != nil
, so the value should be treated as an unwrapped value.The text was updated successfully, but these errors were encountered: