Files
swift-mirror/test/Parse/async-syntax.swift
Allan Shortlidge cb578172ea Tests: Remove -disable-availability-checking in more tests that use concurrency.
Use the `%target-swift-5.1-abi-triple` substitution to compile the tests for
deployment to the minimum OS versions required for use of _Concurrency APIs,
instead of disabling availability checking.
2024-10-19 12:35:20 -07:00

30 lines
657 B
Swift

// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple
// REQUIRES: concurrency
func asyncGlobal1() async { }
func asyncGlobal2() async throws { }
typealias AsyncFunc1 = () async -> ()
typealias AsyncFunc2 = () async throws -> ()
typealias AsyncFunc3 = (_ a: Bool, _ b: Bool) async throws -> ()
func testTypeExprs() {
let _ = [() async -> ()]()
let _ = [() async throws -> ()]()
}
func testAwaitOperator() async {
let _ = await asyncGlobal1()
}
func testAsyncClosure() {
let _ = { () async in 5 }
let _ = { () throws in 5 }
let _ = { () async throws in 5 }
}
func testAwait() async {
let _ = await asyncGlobal1()
}