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
Sema: Teach rethrows checking about 'nil' default arguments
In Swift 5.4, this worked:
func foo(_: (() throws -> ())? = nil) rethrows {}
foo() // no 'try' needed
However, this was an accident, because this was also accepted:
func foo(_: (() throws -> ())? = { throw ... }) rethrows {}
foo() // 'try' *should* be required here
This got fixed at some point recently, but since people rely on the
old case working for 'nil', let's add back a check for a 'nil'
default parameter.
Fixes rdar://problem/76169080.
0 commit comments