Sure, I thought, but it turned out to be more difficult than I anticipated:
func without_throw() -> Int {
return 0
}
func with_throw() throws -> Int {
return 0
}
public func test(_ arg: (() throws -> Int)) rethrows -> () {
let _ = try! arg()
return
}
// These all work with Apple's compiler:
test(without_throw) // E: No matching overload
test { return 0 } // E: No overload that accepts a trailing closure
try! test(with_throw)
print("pass")