@@ -753,6 +753,41 @@ func testGenericSinglePayloadEnumManyXI() {
753753
754754testGenericSinglePayloadEnumManyXI ( )
755755
756+ struct RefPlusEnumResolve {
757+ let x : SimpleClass
758+ let y : ResilientSinglePayloadEnumComplex
759+ }
760+
761+ func testRefPlusEnumResolve( ) {
762+ let ptr = allocateInternalGenericPtr ( of: RefPlusEnumResolve . self)
763+
764+ do {
765+ let x = RefPlusEnumResolve ( x: SimpleClass ( x: 23 ) , y: . nonEmpty( . nonEmpty1( SimpleClass ( x: 23 ) ) ) )
766+ testGenericInit ( ptr, to: x)
767+ }
768+
769+ do {
770+ let y = RefPlusEnumResolve ( x: SimpleClass ( x: 23 ) , y: . nonEmpty( . nonEmpty1( SimpleClass ( x: 23 ) ) ) )
771+ // CHECK: Before deinit
772+ print ( " Before deinit " )
773+
774+ // CHECK-NEXT: SimpleClass deinitialized!
775+ // CHECK-NEXT: SimpleClass deinitialized!
776+ testGenericAssign ( ptr, from: y)
777+ }
778+
779+ // CHECK-NEXT: Before deinit
780+ print ( " Before deinit " )
781+
782+ // CHECK-NEXT: SimpleClass deinitialized!
783+ // CHECK-NEXT: SimpleClass deinitialized!
784+ testGenericDestroy ( ptr, of: RefPlusEnumResolve . self)
785+
786+ ptr. deallocate ( )
787+ }
788+
789+ testRefPlusEnumResolve ( )
790+
756791func testResilientSingletonEnumTag( ) {
757792 let x = switch getResilientSingletonEnumNonEmpty ( SimpleClass ( x: 23 ) ) {
758793 case . nonEmpty: 0
@@ -939,6 +974,41 @@ func testResilientPayloadSinglePayloadEnum() {
939974
940975testResilientPayloadSinglePayloadEnum ( )
941976
977+ struct SinglePayloadSimpleResolve {
978+ let x : ResilientSinglePayloadEnumSimple
979+ let y : ResilientSinglePayloadEnumComplex
980+ }
981+
982+ func testSinglePayloadSimpleResolve( ) {
983+ let ptr = allocateInternalGenericPtr ( of: SinglePayloadSimpleResolve . self)
984+
985+ do {
986+ let x = SinglePayloadSimpleResolve ( x: . nonEmpty( SimpleClass ( x: 23 ) ) , y: . nonEmpty( . nonEmpty1( SimpleClass ( x: 23 ) ) ) )
987+ testGenericInit ( ptr, to: x)
988+ }
989+
990+ do {
991+ let y = SinglePayloadSimpleResolve ( x: . nonEmpty( SimpleClass ( x: 32 ) ) , y: . nonEmpty( . nonEmpty1( SimpleClass ( x: 32 ) ) ) )
992+ // CHECK: Before deinit
993+ print ( " Before deinit " )
994+
995+ // CHECK-NEXT: SimpleClass deinitialized!
996+ // CHECK-NEXT: SimpleClass deinitialized!
997+ testGenericAssign ( ptr, from: y)
998+ }
999+
1000+ // CHECK-NEXT: Before deinit
1001+ print ( " Before deinit " )
1002+
1003+ // CHECK-NEXT: SimpleClass deinitialized!
1004+ // CHECK-NEXT: SimpleClass deinitialized!
1005+ testGenericDestroy ( ptr, of: SinglePayloadSimpleResolve . self)
1006+
1007+ ptr. deallocate ( )
1008+ }
1009+
1010+ testSinglePayloadSimpleResolve ( )
1011+
9421012#if os(macOS)
9431013
9441014import Foundation
0 commit comments