@@ -2403,15 +2403,19 @@ namespace {
2403
2403
properties =
2404
2404
applyLifetimeAnnotation (D->getLifetimeAnnotation (), properties);
2405
2405
2406
- if (D->canBeNoncopyable ()) {
2406
+ GenericEnvironment *env = nullptr ;
2407
+ if (auto sig = origType.getGenericSignatureOrNull ())
2408
+ env = sig.getGenericEnvironment ();
2409
+
2410
+ if (structType->isNoncopyable (env)) {
2407
2411
properties.setNonTrivial ();
2408
2412
properties.setLexical (IsLexical);
2409
2413
if (properties.isAddressOnly ())
2410
2414
return handleMoveOnlyAddressOnly (structType, properties);
2411
2415
return new (TC) MoveOnlyLoadableStructTypeLowering (
2412
2416
structType, properties, Expansion);
2413
2417
}
2414
- if (!D ->isEscapable ()) {
2418
+ if (!structType ->isEscapable (env )) {
2415
2419
properties.setNonTrivial ();
2416
2420
}
2417
2421
return handleAggregateByProperties<LoadableStructTypeLowering>(structType,
@@ -2487,7 +2491,11 @@ namespace {
2487
2491
properties =
2488
2492
applyLifetimeAnnotation (D->getLifetimeAnnotation (), properties);
2489
2493
2490
- if (D->canBeNoncopyable ()) {
2494
+ GenericEnvironment *env = nullptr ;
2495
+ if (auto sig = origType.getGenericSignatureOrNull ())
2496
+ env = sig.getGenericEnvironment ();
2497
+
2498
+ if (enumType->isNoncopyable (env)) {
2491
2499
properties.setNonTrivial ();
2492
2500
properties.setLexical (IsLexical);
2493
2501
if (properties.isAddressOnly ())
@@ -2496,6 +2504,8 @@ namespace {
2496
2504
MoveOnlyLoadableEnumTypeLowering (enumType, properties, Expansion);
2497
2505
}
2498
2506
2507
+ assert (enumType->isEscapable (env) && " missing typelowering case here!" );
2508
+
2499
2509
return handleAggregateByProperties<LoadableEnumTypeLowering>(enumType,
2500
2510
properties);
2501
2511
}
0 commit comments