Skip to content

Commit fe31c61

Browse files
committed
AST: Remove stray assert
A pack archetype from an outer expansion here is treated as a scalar.
1 parent b2e2b02 commit fe31c61

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lib/AST/ParameterPack.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,6 @@ static CanPackType getReducedShapeOfPack(const ASTContext &ctx,
307307
}
308308

309309
// Use () as a placeholder for scalar shape.
310-
assert(!elt->template is<PackArchetypeType>() &&
311-
"Pack archetype outside of a pack expansion");
312310
elts.push_back(ctx.TheEmptyTupleType);
313311
}
314312

test/IRGen/pack_metadata_dealloc.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,13 @@ func f<each T: P>(_ t: repeat each T) -> (repeat (each T).A) {
1818
// CHECK-NOT: call ptr llvm.stacksave.p0()
1919
// CHECK: call void @llvm.stackrestore.p0(ptr [[SPSAVE2]])
2020
// CHECK: call void @llvm.stackrestore.p0(ptr [[SPSAVE1]])
21-
// CHECK: ret void
21+
// CHECK: ret void
22+
23+
struct G<each T> {
24+
init(_: repeat each T) {}
25+
}
26+
27+
func f2<each T: P, each U>(t: repeat each T, u: repeat each U) async -> (repeat G<(each T).A, repeat each U>) {
28+
let x = (repeat G((each t).a, repeat each u))
29+
return x
30+
}

0 commit comments

Comments
 (0)