Avatar
Avatar
trickart
@swift-6.2 enum FooError: Error { case bar } var closure2: (() throws -> Int)? closure2 = { throws(FooError) in throw .bar }
exit status 1 with stderr:<stdin>:5:14: error: expected expression 3 | var closure2: (() throws -> Int)? 4 | 5 | closure2 = { throws(FooError) in throw .bar } | `- error: expected expression 6 | <stdin>:5:41: error: type 'any Error' has no member 'bar' 3 | var closure2: (() throws -> Int)? 4 | 5 | closure2 = { throws(FooError) in throw .bar } | `- error: type 'any Error' has no member 'bar' 6 |