@@ -64,11 +64,13 @@ func makeAsyncClosuresSynchronously(bop: inout Bop) -> (() async -> Void) {
64
64
bop. foo ( ) // expected-warning@:9{{'foo' is unavailable from asynchronous contexts}}
65
65
bop. muppet ( ) // expected-warning@:9{{'muppet' is unavailable from asynchronous contexts}}
66
66
unavailableFunction ( ) // expected-warning@:5{{'unavailableFunction' is unavailable from asynchronous contexts}}
67
+ noasyncFunction ( ) // expected-error@:5{{'noasyncFunction' is unavailable from asynchronous contexts}}
67
68
68
69
// Can use them from synchronous closures
69
70
_ = { Bop ( ) } ( )
70
71
_ = { bop. foo ( ) } ( )
71
72
_ = { bop. muppet ( ) } ( )
73
+ _ = { noasyncFunction ( ) } ( )
72
74
73
75
// Unavailable global function
74
76
foo ( ) // expected-warning{{'foo' is unavailable from asynchronous contexts}}
@@ -87,6 +89,7 @@ func asyncFunc() async { // expected-error{{asynchronous global function 'asyncF
87
89
bop. foo ( ) // expected-warning@:7{{'foo' is unavailable from asynchronous contexts}}
88
90
bop. muppet ( ) // expected-warning@:7{{'muppet' is unavailable from asynchronous contexts}}
89
91
unavailableFunction ( ) // expected-warning@:3{{'unavailableFunction' is unavailable from asynchronous contexts}}
92
+ noasyncFunction ( ) // expected-error@:3{{'noasyncFunction' is unavailable from asynchronous contexts}}
90
93
91
94
// Unavailable global function
92
95
foo ( ) // expected-warning{{'foo' is unavailable from asynchronous contexts}}
@@ -101,6 +104,7 @@ func asyncFunc() async { // expected-error{{asynchronous global function 'asyncF
101
104
bop. foo ( )
102
105
bop. muppet ( )
103
106
unavailableFunction ( )
107
+ noasyncFunction ( )
104
108
105
109
_ = { ( ) async -> Void in
106
110
// Check Unavailable things inside of a nested async closure
@@ -109,6 +113,7 @@ func asyncFunc() async { // expected-error{{asynchronous global function 'asyncF
109
113
bop. muppet ( ) // expected-warning@:11{{'muppet' is unavailable from asynchronous contexts}}
110
114
_ = Bop ( ) // expected-warning@:11{{'init' is unavailable from asynchronous contexts; Use Bop(a: Int) instead}}
111
115
unavailableFunction ( ) // expected-warning@:7{{'unavailableFunction' is unavailable from asynchronous contexts}}
116
+ noasyncFunction ( ) // expected-error@:7{{'noasyncFunction' is unavailable from asynchronous contexts}}
112
117
}
113
118
}
114
119
@@ -118,6 +123,7 @@ func asyncFunc() async { // expected-error{{asynchronous global function 'asyncF
118
123
bop. foo ( ) // expected-warning@:9{{'foo' is unavailable from asynchronous contexts}}
119
124
bop. muppet ( ) // expected-warning@:9{{'muppet' is unavailable from asynchronous contexts}}
120
125
unavailableFunction ( ) // expected-warning@:5{{'unavailableFunction' is unavailable from asynchronous contexts}}
126
+ noasyncFunction ( ) // expected-error@:5{{'noasyncFunction' is unavailable from asynchronous contexts}}
121
127
122
128
_ = {
123
129
foo ( )
0 commit comments