mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
22 lines
308 B
Swift
22 lines
308 B
Swift
// RUN: %target-run-simple-swift
|
|
|
|
// REQUIRES: executable_test
|
|
|
|
func test(reportError: ((String) -> (Void))? = nil) {
|
|
let reportError = reportError ?? { error in
|
|
print(error)
|
|
}
|
|
|
|
for _ in 0..<1 {
|
|
reportError("foo bar baz")
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
test { error in
|
|
print(error)
|
|
}
|
|
}
|
|
|
|
main()
|