Skip to content

Commit 7d1c505

Browse files
authored
Merge pull request #75673 from slavapestov/fix-issue-75329
SIL: Pass SubstFlags::PreservePackExpansionLevel in a spot in SILVerifier
2 parents 4ef187b + 293a36c commit 7d1c505

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6316,7 +6316,9 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
63166316
SILType::getPrimitiveObjectType(indexedElementType);
63176317
auto substTargetElementSILType =
63186318
targetElementSILType.subst(F.getModule(),
6319-
substTypes, substConformances);
6319+
substTypes, substConformances,
6320+
CanGenericSignature(),
6321+
SubstFlags::PreservePackExpansionLevel);
63206322
requireSameType(indexedElementSILType, substTargetElementSILType,
63216323
"lanewise-substituted pack element type didn't "
63226324
"match expected element type");
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %target-swift-frontend -emit-ir %s -disable-availability-checking
2+
3+
// https://github.com/swiftlang/swift/issues/75329
4+
5+
struct GPack1<each P, T> {}
6+
struct GPack2<each P> {
7+
struct G<T> {}
8+
}
9+
10+
func test<each T>(
11+
example1: repeat GPack1<repeat each T, each T>,
12+
example2: repeat GPack2<repeat each T>.G<each T>
13+
) {
14+
let _ = (repeat each example1) // Boom
15+
}

0 commit comments

Comments
 (0)