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
If you attempt to use a guard statement to declare a variable that shadows an existing variable, a compiler error prevents you from accessing the existing variable in the body of the guard.
funcfooBar (foo: String?, bar: String?) -> Bool {
guardletfoo = foo, letbar = barelse {
returnfoo == nil && bar == nil// "Variable declared in 'guard' condition is not usable in its body"
}
returntrue
}
The text was updated successfully, but these errors were encountered:
Looks like this has been fixed on main. I think by some recent changes to name lookup @slavapestov implemented. montyoverzero (JIRA User) Could you please use the latest main branch snapshot to verify and close?
Environment
macOS 10.13.6, Xcode 9.4.1, Swift 4.1
Additional Detail from JIRA
md5: 3b98c8084924683eb7cee7d4d9ddef56
Issue Description:
If you attempt to use a guard statement to declare a variable that shadows an existing variable, a compiler error prevents you from accessing the existing variable in the body of the guard.
The text was updated successfully, but these errors were encountered: