Elvis Operator?

An extra pair of braces and parentheses (and a try) makes it work:

let a = try maybeA() ?? { throw SomeError() }()
2 Likes