@@ -301,3 +301,41 @@ func testImplicitWrapperWithResilientStruct() {
301
301
// property wrapper init from projected value of $value #1 in closure #1 in implicit closure #1 in testImplicitWrapperWithResilientStruct()
302
302
// CHECK-LABEL: sil private [ossa] @$s26property_wrapper_parameter38testImplicitWrapperWithResilientStructyyFyAA010ProjectionF0Vy11def_structA1AVGcfu_yAHcfU_6$valueL_AHvpfW : $@convention(thin) (@in ProjectionWrapper<A>) -> @out ProjectionWrapper<A>
303
303
}
304
+
305
+ func takesAutoclosure( _: @autoclosure ( ) -> Int ) { }
306
+
307
+ // CHECK-LABEL: sil hidden [ossa] @$s26property_wrapper_parameter12testCaptures3ref5valueySi_AA7WrapperVySiGtF : $@convention(thin) (Int, Wrapper<Int>) -> ()
308
+ func testCaptures( @ClassWrapper ref: Int , @Wrapper value: Int ) {
309
+ takesAutoclosure ( ref)
310
+ // implicit closure #1 in testCaptures(ref:value:)
311
+ // CHECK-LABEL: sil private [transparent] [ossa] @$s26property_wrapper_parameter12testCaptures3ref5valueySi_AA7WrapperVySiGtFSiyXEfu_ : $@convention(thin) (@guaranteed ClassWrapper<Int>) -> Int
312
+
313
+ let _: ( ) -> Void = {
314
+ _ = ref
315
+ ref = 100
316
+ }
317
+ // closure #1 in testCaptures(ref:value:)
318
+ // CHECK-LABEL: sil private [ossa] @$s26property_wrapper_parameter12testCaptures3ref5valueySi_AA7WrapperVySiGtFyycfU_ : $@convention(thin) (@guaranteed ClassWrapper<Int>) -> ()
319
+
320
+ let _: ( ) -> Projection < Int > = { $value }
321
+ // closure #2 in testCaptures(ref:value:)
322
+ // CHECK-LABEL: sil private [ossa] @$s26property_wrapper_parameter12testCaptures3ref5valueySi_AA7WrapperVySiGtFAA10ProjectionVySiGycfU0_ : $@convention(thin) (Wrapper<Int>) -> Projection<Int>
323
+
324
+ let _: ( ProjectionWrapper < Int > ) -> Void = { $x in
325
+ _ = { x }
326
+ _ = { $x }
327
+ }
328
+ // Make sure there are 4 closures here with the right arguments
329
+
330
+ // implicit closure #2 in testCaptures(ref:value:)
331
+ // CHECK-LABEL: sil private [ossa] @$s26property_wrapper_parameter12testCaptures3ref5valueySi_AA7WrapperVySiGtFyAA010ProjectionH0VySiGcfu0_ : $@convention(thin) (ProjectionWrapper<Int>) -> ()
332
+
333
+ // closure #3 in implicit closure #2 in testCaptures(ref:value:)
334
+ // CHECK-LABEL: sil private [ossa] @$s26property_wrapper_parameter12testCaptures3ref5valueySi_AA7WrapperVySiGtFyAA010ProjectionH0VySiGcfu0_yAJcfU1_ : $@convention(thin) (ProjectionWrapper<Int>) -> ()
335
+
336
+ // closure #1 in closure #2 in implicit closure #2 in testCaptures(ref:value:)
337
+ // CHECK-LABEL: sil private [ossa] @$s26property_wrapper_parameter12testCaptures3ref5valueySi_AA7WrapperVySiGtFyAA010ProjectionH0VySiGcfu0_yAJcfU1_SiycfU_ : $@convention(thin) (ProjectionWrapper<Int>) -> Int
338
+
339
+ // closure #2 in closure #2 in implicit closure #2 in testCaptures(ref:value:)
340
+ // CHECK-LABEL: sil private [ossa] @$s26property_wrapper_parameter12testCaptures3ref5valueySi_AA7WrapperVySiGtFyAA010ProjectionH0VySiGcfu0_yAJcfU1_AJycfU0_ : $@convention(thin) (ProjectionWrapper<Int>) -> ProjectionWrapper<Int>
341
+ }
0 commit comments