Skip to content

Commit d8c6f98

Browse files
committed
[TypeLowering] Record pack used in aggregate sig.
Every `LowerType::visit*` function eventually calls through to a `LowerType::handle*` function. After #81581, every `LowerType::handle*` needs to set the `hasPack` flag based on the passed-in type by calling `mergeHasPack`. Add the missing call in the `handleAggregateByProperties` function. rdar://152580661
1 parent 0a9c577 commit d8c6f98

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

lib/SIL/IR/TypeLowering.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,6 +2742,7 @@ namespace {
27422742
template <class LoadableLoweringClass>
27432743
TypeLowering *handleAggregateByProperties(CanType type,
27442744
RecursiveProperties props) {
2745+
props = mergeHasPack(HasPack_t(type->hasAnyPack()), props);
27452746
if (props.isAddressOnly()) {
27462747
return handleAddressOnly(type, props);
27472748
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-swift-frontend %s -target %target-swift-5.9-abi-triple -emit-ir
2+
3+
struct H<T> {
4+
var packs: [Pack<T>] {
5+
id(_packs)
6+
}
7+
let _packs: [Pack<T>]
8+
}
9+
10+
struct Pack<each T> {}
11+
12+
func id<T>(_ t: T) -> T {
13+
return t
14+
}

0 commit comments

Comments
 (0)