1- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_CLOSURE_PARAM_1 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
2- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_CLOSURE_PARAM_2 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
3-
4- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_1 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
5- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_2 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
6- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_3 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
7- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_4 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
8- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_5 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
9- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RESOLVE_PARENT_PARAM_6 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
10-
11- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
12-
13- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
14- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_2 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
15- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_3 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
16- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_4 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
17- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_5 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
18- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_6 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
19- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_7 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
20- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_8 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
21- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_9 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
22- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DELAYED_10 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS_AND_LOCAL1
23-
24- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
25- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_2 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
26- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_3 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
27- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_4 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
28- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_5 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
29- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_6 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
30- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_7 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
31- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_8 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
32- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_9 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
33- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_10 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
34- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_11 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
35- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_12 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
36- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_13 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
37- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_14 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
38- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_15 | %FileCheck %s -check-prefix=FOO_OBJECT_DOT
39- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_16 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
40- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_17 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
41- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_18 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
42- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TRAILING_CLOSURE_19 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
43- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_INHERITANCE_IN_CLOSURE_0 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
44- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLASS_INHERITANCE_IN_CLOSURE_0 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
45- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARGUMENT_TYPE_IN_CLOSURE_0 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
46- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_INHERITANCE_IN_CLOSURE_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
47- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLASS_INHERITANCE_IN_CLOSURE_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
48- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARGUMENT_TYPE_IN_CLOSURE_1 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
49- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_INHERITANCE_IN_CLOSURE_2 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
50- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLASS_INHERITANCE_IN_CLOSURE_2 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
51- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARGUMENT_TYPE_IN_CLOSURE_2 | %FileCheck %s -check-prefix=WITH_GLOBAL_DECLS
52- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_PARAM_1 | %FileCheck %s -check-prefix=CLOSURE_PARAM_1
53- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_PARAM_2 | %FileCheck %s -check-prefix=CLOSURE_PARAM_2
54- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_IIFE_1 | %FileCheck %s -check-prefix=IN_IIFE_1
55- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_IIFE_2 | %FileCheck %s -check-prefix=IN_IIFE_1
56- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_IIFE_3 | %FileCheck %s -check-prefix=IN_IIFE_1
57- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_IIFE_4 | %FileCheck %s -check-prefix=IN_IIFE_1
58- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ERROR_IN_CLOSURE_IN_INITIALIZER | %FileCheck %s -check-prefix=ERROR_IN_CLOSURE_IN_INITIALIZER
59- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DECL_IN_CLOSURE_IN_TOPLEVEL_INIT | %FileCheck %s -check-prefix=DECL_IN_CLOSURE_IN_TOPLEVEL_INIT
60- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=SINGLE_EXPR_CLOSURE_CONTEXT | %FileCheck %s -check-prefix=SINGLE_EXPR_CLOSURE_CONTEXT
61- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=SINGLE_TERNARY_EXPR_CLOSURE_CONTEXT | %FileCheck %s -check-prefix=SINGLE_TERNARY_EXPR_CLOSURE_CONTEXT
62-
1+ // RUN: %empty-directory(%t)
2+ // RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t
633
644// ERROR_COMMON: found code completion token
655// ERROR_COMMON-NOT: Begin completions
@@ -85,74 +25,74 @@ struct FooStruct {
8525//===--- Check that we can resolve closure parameters.
8626
8727func testResolveClosureParam1( ) {
88- var x = { ( fs: FooStruct ) in fs. #^RESOLVE_CLOSURE_PARAM_1^# }
28+ var x = { ( fs: FooStruct ) in fs. #^RESOLVE_CLOSURE_PARAM_1? check = FOO_OBJECT_DOT ^# }
8929}
9030
9131func testResolveClosureParam2( ) {
92- { ( fs: FooStruct ) in fs. #^RESOLVE_CLOSURE_PARAM_2^# }
32+ { ( fs: FooStruct ) in fs. #^RESOLVE_CLOSURE_PARAM_2? check = FOO_OBJECT_DOT ^# }
9333}
9434
9535//===--- Check that we can resolve parent function parameters.
9636
9737func testResolveParentParam1( _ fs: FooStruct ) {
98- { ( a: Int ) in fs. #^RESOLVE_PARENT_PARAM_1^# }
38+ { ( a: Int ) in fs. #^RESOLVE_PARENT_PARAM_1? check = FOO_OBJECT_DOT ^# }
9939}
10040
10141func testResolveParentParam2( _ fs: FooStruct ) {
102- { fs. #^RESOLVE_PARENT_PARAM_2^# }
42+ { fs. #^RESOLVE_PARENT_PARAM_2? check = FOO_OBJECT_DOT ^# }
10343}
10444
10545class TestResolveParentParam3 {
10646 func testResolveParentParam3a( _ fs: FooStruct ) {
107- { ( a: Int ) in fs. #^RESOLVE_PARENT_PARAM_3^# }
47+ { ( a: Int ) in fs. #^RESOLVE_PARENT_PARAM_3? check = FOO_OBJECT_DOT ^# }
10848 }
10949}
11050
11151class TestResolveParentParam4 {
11252 func testResolveParentParam4a( _ fs: FooStruct ) {
113- { fs. #^RESOLVE_PARENT_PARAM_4^# }
53+ { fs. #^RESOLVE_PARENT_PARAM_4? check = FOO_OBJECT_DOT ^# }
11454 }
11555}
11656
11757func testResolveParentParam5( _ fs: FooStruct ) {
11858 func testResolveParentParam5a( ) {
119- { fs. #^RESOLVE_PARENT_PARAM_5^# }
59+ { fs. #^RESOLVE_PARENT_PARAM_5? check = FOO_OBJECT_DOT ^# }
12060 }
12161}
12262
12363func testResolveParentParam6( ) {
12464 func testResolveParentParam6a( _ fs: FooStruct ) {
125- { fs. #^RESOLVE_PARENT_PARAM_6^# }
65+ { fs. #^RESOLVE_PARENT_PARAM_6? check = FOO_OBJECT_DOT ^# }
12666 }
12767}
12868
12969//===--- Test completion in various statements in closures.
13070
13171func testReturnInClosure1( ) {
13272 var f = { ( ) -> Int in
133- return #^RETURN_1 ^#
73+ return #^RETURN_1 ? check = WITH_GLOBAL_DECLS ^#
13474 }
13575}
13676
13777//===--- Test that we do delayed parsing of closures.
13878
139- var topLevelClosure1 = { #^DELAYED_1 ^# }
79+ var topLevelClosure1 = { #^DELAYED_1 ? check = WITH_GLOBAL_DECLS ^# }
14080
141- var topLevelClosure2 = { func f( ) { #^DELAYED_2 ^# } }
81+ var topLevelClosure2 = { func f( ) { #^DELAYED_2 ? check = WITH_GLOBAL_DECLS ^# } }
14282
143- var topLevelClosure3 = { class C { func f( ) { #^DELAYED_3 ^# } } }
83+ var topLevelClosure3 = { class C { func f( ) { #^DELAYED_3 ? check = WITH_GLOBAL_DECLS ^# } } }
14484
14585class ClassWithClosureMember1 {
146- var c1 = { #^DELAYED_4 ^# }
147- lazy var c2 = { #^DELAYED_5 ^# }
148- var c3 = ( { #^DELAYED_6 ^# } ) ( )
149- lazy var c4 = ( { #^DELAYED_7 ^# } ) ( )
86+ var c1 = { #^DELAYED_4 ? check = WITH_GLOBAL_DECLS ^# }
87+ lazy var c2 = { #^DELAYED_5 ? check = WITH_GLOBAL_DECLS ^# }
88+ var c3 = ( { #^DELAYED_6 ? check = WITH_GLOBAL_DECLS ^# } ) ( )
89+ lazy var c4 = ( { #^DELAYED_7 ? check = WITH_GLOBAL_DECLS ^# } ) ( )
15090}
15191
15292struct NestedStructWithClosureMember1 {
15393 struct Nested {
154- var c1 = { #^DELAYED_8 ^# }
155- lazy var c2 = { #^DELAYED_9 ^# }
94+ var c1 = { #^DELAYED_8 ? check = WITH_GLOBAL_DECLS ^# }
95+ lazy var c2 = { #^DELAYED_9 ? check = WITH_GLOBAL_DECLS ^# }
15696 }
15797}
15898
@@ -164,32 +104,32 @@ struct NestedStructWithClosureMember1 {
164104struct StructWithClosureMemberAndLocal {
165105 var c = {
166106 var x = 0
167- #^DELAYED_10 ^#
107+ #^DELAYED_10 ? check = WITH_GLOBAL_DECLS_AND_LOCAL1 ^#
168108 }
169109}
170110
171111func acceptsTrailingClosureFooVoid( _ code: ( FooStruct ) -> Void ) { }
172112
173113acceptsTrailingClosureFooVoid {
174- #^IN_TRAILING_CLOSURE_1 ^#
114+ #^IN_TRAILING_CLOSURE_1 ? check = WITH_GLOBAL_DECLS ^#
175115}
176116
177117acceptsTrailingClosureFooVoid {
178- $0. #^IN_TRAILING_CLOSURE_2^#
118+ $0. #^IN_TRAILING_CLOSURE_2? check = FOO_OBJECT_DOT ^#
179119}
180120
181121acceptsTrailingClosureFooVoid {
182- item in #^IN_TRAILING_CLOSURE_3 ^#
122+ item in #^IN_TRAILING_CLOSURE_3 ? check = WITH_GLOBAL_DECLS ^#
183123}
184124
185125acceptsTrailingClosureFooVoid {
186- item in item. #^IN_TRAILING_CLOSURE_4^#
126+ item in item. #^IN_TRAILING_CLOSURE_4? check = FOO_OBJECT_DOT ^#
187127}
188128
189129acceptsTrailingClosureFooVoid {
190130 item in
191131 item. instanceFunc0 ( )
192- item. #^IN_TRAILING_CLOSURE_5^#
132+ item. #^IN_TRAILING_CLOSURE_5? check = FOO_OBJECT_DOT ^#
193133}
194134
195135func acceptsListAndTrailingClosureFooVoid(
@@ -198,70 +138,70 @@ func acceptsListAndTrailingClosureFooVoid(
198138
199139acceptsListAndTrailingClosureFooVoid (
200140 [ FooStruct ( instanceVar: 0 ) , FooStruct ( instanceVar: 0 ) ] ) {
201- #^IN_TRAILING_CLOSURE_6 ^#
141+ #^IN_TRAILING_CLOSURE_6 ? check = WITH_GLOBAL_DECLS ^#
202142}
203143
204144acceptsListAndTrailingClosureFooVoid (
205145 [ FooStruct ( instanceVar: 0 ) , FooStruct ( instanceVar: 0 ) ] ) {
206- $0. #^IN_TRAILING_CLOSURE_7^#
146+ $0. #^IN_TRAILING_CLOSURE_7? check = FOO_OBJECT_DOT ^#
207147}
208148
209149acceptsListAndTrailingClosureFooVoid (
210150 [ FooStruct ( instanceVar: 0 ) , FooStruct ( instanceVar: 0 ) ] ) {
211- item in #^IN_TRAILING_CLOSURE_8 ^#
151+ item in #^IN_TRAILING_CLOSURE_8 ? check = WITH_GLOBAL_DECLS ^#
212152}
213153
214154acceptsListAndTrailingClosureFooVoid (
215155 [ FooStruct ( instanceVar: 0 ) , FooStruct ( instanceVar: 0 ) ] ) {
216- item in item. #^IN_TRAILING_CLOSURE_9^#
156+ item in item. #^IN_TRAILING_CLOSURE_9? check = FOO_OBJECT_DOT ^#
217157}
218158
219159acceptsListAndTrailingClosureFooVoid (
220160 [ FooStruct ( instanceVar: 0 ) , FooStruct ( instanceVar: 0 ) ] ) {
221161 item in
222162 item. instanceFunc0 ( )
223- item. #^IN_TRAILING_CLOSURE_10^#
163+ item. #^IN_TRAILING_CLOSURE_10? check = FOO_OBJECT_DOT ^#
224164}
225165
226166func acceptsListAndTrailingClosureTVoid< T> ( _ list: [ T ] , code: ( T ) -> Void ) { }
227167
228168acceptsListAndTrailingClosureTVoid (
229169 [ FooStruct ( instanceVar: 0 ) , FooStruct ( instanceVar: 0 ) ] ) {
230- #^IN_TRAILING_CLOSURE_11 ^#
170+ #^IN_TRAILING_CLOSURE_11 ? check = WITH_GLOBAL_DECLS ^#
231171}
232172
233173acceptsListAndTrailingClosureTVoid (
234174 [ FooStruct ( instanceVar: 0 ) , FooStruct ( instanceVar: 0 ) ] ) {
235- $0. #^IN_TRAILING_CLOSURE_12^#
175+ $0. #^IN_TRAILING_CLOSURE_12? check = FOO_OBJECT_DOT ^#
236176}
237177
238178acceptsListAndTrailingClosureTVoid (
239179 [ FooStruct ( instanceVar: 0 ) , FooStruct ( instanceVar: 0 ) ] ) {
240- item in #^IN_TRAILING_CLOSURE_13 ^#
180+ item in #^IN_TRAILING_CLOSURE_13 ? check = WITH_GLOBAL_DECLS ^#
241181}
242182
243183acceptsListAndTrailingClosureTVoid (
244184 [ FooStruct ( instanceVar: 0 ) , FooStruct ( instanceVar: 0 ) ] ) {
245- item in item. #^IN_TRAILING_CLOSURE_14^#
185+ item in item. #^IN_TRAILING_CLOSURE_14? check = FOO_OBJECT_DOT ^#
246186}
247187
248188acceptsListAndTrailingClosureTVoid (
249189 [ FooStruct ( instanceVar: 0 ) , FooStruct ( instanceVar: 0 ) ] ) {
250190 item in
251191 item. instanceFunc0 ( )
252- item. #^IN_TRAILING_CLOSURE_15^#
192+ item. #^IN_TRAILING_CLOSURE_15? check = FOO_OBJECT_DOT ^#
253193}
254194
255195func getInt( ) -> Int ? { return 0 }
256196func testAcceptsTrailingClosureInt1( ) {
257- acceptsTrailingClosureFooVoid { #^IN_TRAILING_CLOSURE_16 ^# in
197+ acceptsTrailingClosureFooVoid { #^IN_TRAILING_CLOSURE_16 ? check = WITH_GLOBAL_DECLS ^# in
258198 if let myvar = getInt ( ) {
259199 }
260200 }
261201}
262202func testAcceptsTrailingClosureInt2( ) {
263203 acceptsTrailingClosureFooVoid {
264- #^IN_TRAILING_CLOSURE_17 ^#
204+ #^IN_TRAILING_CLOSURE_17 ? check = WITH_GLOBAL_DECLS ^#
265205 if let myvar = getInt ( ) {
266206 }
267207 }
@@ -270,55 +210,55 @@ func testAcceptsTrailingClosureInt3() {
270210 acceptsTrailingClosureFooVoid {
271211 if let myvar = getInt ( ) {
272212 }
273- #^IN_TRAILING_CLOSURE_18 ^#
213+ #^IN_TRAILING_CLOSURE_18 ? check = WITH_GLOBAL_DECLS ^#
274214 }
275215}
276216func testAcceptsTrailingClosureInt4( ) {
277217 acceptsTrailingClosureFooVoid {
278218 if let myvar = getInt ( ) {
279- #^IN_TRAILING_CLOSURE_19 ^#
219+ #^IN_TRAILING_CLOSURE_19 ? check = WITH_GLOBAL_DECLS ^#
280220 }
281221 }
282222}
283223
284224func testTypeInClosure1( ) {
285225 acceptsTrailingClosureFooVoid {
286- struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_0 ^#
226+ struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_0 ? check = WITH_GLOBAL_DECLS ^#
287227 }
288228}
289229func testTypeInClosure2( ) {
290230 acceptsTrailingClosureFooVoid {
291- class S : #^CLASS_INHERITANCE_IN_CLOSURE_0 ^#
231+ class S : #^CLASS_INHERITANCE_IN_CLOSURE_0 ? check = WITH_GLOBAL_DECLS ^#
292232 }
293233}
294234func testTypeInClosure3( ) {
295235 acceptsTrailingClosureFooVoid {
296- func test( _ x: #^ARGUMENT_TYPE_IN_CLOSURE_0 ^#
236+ func test( _ x: #^ARGUMENT_TYPE_IN_CLOSURE_0 ? check = WITH_GLOBAL_DECLS ^#
297237 }
298238}
299239acceptsTrailingClosureFooVoid {
300- struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_1 ^#
240+ struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_1 ? check = WITH_GLOBAL_DECLS ^#
301241}
302242acceptsTrailingClosureFooVoid {
303- class S : #^CLASS_INHERITANCE_IN_CLOSURE_1 ^#
243+ class S : #^CLASS_INHERITANCE_IN_CLOSURE_1 ? check = WITH_GLOBAL_DECLS ^#
304244}
305245acceptsTrailingClosureFooVoid {
306- func test( _ x: #^ARGUMENT_TYPE_IN_CLOSURE_1 ^#
246+ func test( _ x: #^ARGUMENT_TYPE_IN_CLOSURE_1 ? check = WITH_GLOBAL_DECLS ^#
307247}
308248
309249struct LazyVar1 {
310250 lazy var x: Int = {
311- struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_2 ^#
251+ struct S : #^STRUCT_INHERITANCE_IN_CLOSURE_2? check = WITH_GLOBAL_DECLS ^#
312252 } ( )
313253}
314254struct LazyVar2 {
315255 lazy var x: Int = {
316- class S : #^CLASS_INHERITANCE_IN_CLOSURE_2 ^#
256+ class S : #^CLASS_INHERITANCE_IN_CLOSURE_2? check = WITH_GLOBAL_DECLS ^#
317257 } ( )
318258}
319259struct LazyVar3 {
320260 lazy var x : Int = {
321- func test( _ x: #^ARGUMENT_TYPE_IN_CLOSURE_2 ^#
261+ func test( _ x: #^ARGUMENT_TYPE_IN_CLOSURE_2 ? check = WITH_GLOBAL_DECLS ^#
322262 } ( )
323263}
324264
@@ -355,19 +295,19 @@ var testIIFEVar: BarStruct = {
355295} ( )
356296testIIFEVar = {
357297 var obj = BarStruct ( )
358- obj. enum Val = . #^IN_IIFE_2 ^#
298+ obj. enum Val = . #^IN_IIFE_2 ? check = IN_IIFE_ 1 ^#
359299 return obj
360300} ( )
361301
362302func testIIFE( ) {
363303 var testIIFEVar : FooStruct = {
364304 var obj = BarStruct ( )
365- obj. enumVal = . #^IN_IIFE_3 ^#
305+ obj. enumVal = . #^IN_IIFE_3 ? check = IN_IIFE_1 ^#
366306 return obj
367307 } ( )
368308 testIIFEVar = {
369309 var obj = BarStruct ( )
370- obj. enumVal = . #^IN_IIFE_4 ^#
310+ obj. enumVal = . #^IN_IIFE_4 ? check = IN_IIFE_1 ^#
371311 return obj
372312 } ( )
373313}
0 commit comments