- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathasync-syntax.swift
29 lines (22 loc) · 657 Bytes
/
async-syntax.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple
// REQUIRES: concurrency
func asyncGlobal1()async{}
func asyncGlobal2()asyncthrows{}
typealiasAsyncFunc1=()async->()
typealiasAsyncFunc2=()asyncthrows->()
typealiasAsyncFunc3=(_ a:Bool, _ b:Bool)asyncthrows->()
func testTypeExprs(){
let _ =[()async->()]()
let _ =[()asyncthrows->()]()
}
func testAwaitOperator()async{
let _ =awaitasyncGlobal1()
}
func testAsyncClosure(){
let _ ={()asyncin5}
let _ ={()throwsin5}
let _ ={()asyncthrowsin5}
}
func testAwait()async{
let _ =awaitasyncGlobal1()
}