Skip to content

Commit 50deb13

Browse files
committed
[TypeLowering] Loosen assertion.
Types appearing in the context of variadic generics may be trivial but not conform to BitwiseCopyable.
1 parent 8621742 commit 50deb13

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/SIL/IR/TypeLowering.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,13 +3072,20 @@ void TypeConverter::verifyTrivialLowering(const TypeLowering &lowering,
30723072
// }
30733073
// (5) being defined in a different module
30743074
// (6) being defined in a module built from interface
3075+
// (7) being or containing a variadic generic type which doesn't conform
3076+
// unconditionally but does in this case
30753077
bool hasNoNonconformingNode = visitAggregateLeaves(
30763078
origType, substType, forExpansion,
30773079
/*isLeafAggregate=*/
30783080
[&](auto ty, auto origTy, auto *field, auto index) -> bool {
3081+
// These show up in the context of non-conforming variadic generics
3082+
// which may lack a conformance (case (7)).
3083+
if (isa<SILPackType>(ty) || isa<PackExpansionType>(ty))
3084+
return true;
3085+
30793086
auto *nominal = ty.getAnyNominal();
3080-
// Non-nominal aggregates must not be responsible for non-conformance;
3081-
// walk into them.
3087+
// Only pack-related non-nominal aggregates may be responsible for
3088+
// non-conformance; walk into the rest.
30823089
if (!nominal)
30833090
return false;
30843091

@@ -3113,6 +3120,11 @@ void TypeConverter::verifyTrivialLowering(const TypeLowering &lowering,
31133120

31143121
auto isTopLevel = !field;
31153122

3123+
// These show up in the context of non-conforming variadic generics
3124+
// which may lack a conformance (case (7)).
3125+
if (isa<SILPackType>(ty) || isa<PackExpansionType>(ty))
3126+
return false;
3127+
31163128
// A BitwiseCopyable conformer appearing within its layout doesn't
31173129
// explain why substType doesn't itself conform.
31183130
if (M.checkConformance(ty, bitwiseCopyableProtocol))

0 commit comments

Comments
 (0)