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
The following program runs and prints a series of numbers, so either the warning is misleading or the behavior is not as intended.
func foo() -> Int {
return _E.bar
struct _E { // WARNING: Code after 'return' will never be executed
private static var count = 0
static var bar: Int {
count += (Bool.random() ? foo() : 1)
return count
}
}
}
for _ in 0 ..< 7 { print(foo()) }
Additional Detail from JIRA
md5: 93178b7c4343d2f9fee8e7bba810aecd
Issue Description:
The following program runs and prints a series of numbers, so either the warning is misleading or the behavior is not as intended.
Related thread (with more similar examples):
https://forums.swift.org/t/should-this-misleading-warning-be-here/40678
The text was updated successfully, but these errors were encountered: