We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1284d0 commit 95edef7Copy full SHA for 95edef7
test/Concurrency/Runtime/basic_future.swift
@@ -16,9 +16,14 @@ extension DispatchQueue {
16
}
17
18
19
+func formGreeting(name: String) async -> String {
20
+ return "Hello \(name) from async world"
21
+}
22
+
23
func test(name: String) {
24
let taskHandle = DispatchQueue.main.async { () async -> String in
- return "Hello \(name) from async world"
25
+ let greeting = await formGreeting(name: name)
26
+ return greeting + "!"
27
28
29
_ = DispatchQueue.main.async { () async in
@@ -28,7 +33,7 @@ func test(name: String) {
33
let result = await try! taskHandle.get()
34
// CHECK: Hello Ted from async world
30
35
print(result)
31
- assert(result == "Hello Ted from async world")
36
+ assert(result == "Hello Ted from async world!")
32
37
exit(0)
38
39
0 commit comments