Skip to content

Commit 272ada5

Browse files
committed
SIL: Fix another bug in verifyDynamicPackIndexStructuralEquality()
Fixes rdar://problem/109911237.
1 parent 91dd6a6 commit 272ada5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5768,7 +5768,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
57685768
// we found above with the corresponding lane of the pack substitution.
57695769
auto substTypes = [&](SubstitutableType *type) -> Type {
57705770
auto it = allOpened.find(type->getCanonicalType());
5771-
if (it == allOpened.end()) return Type();
5771+
if (it == allOpened.end()) return type;
57725772
auto pack = it->second;
57735773
auto packElementType = pack.getElementType(componentIndex);
57745774
if (auto exp = dyn_cast<PackExpansionType>(packElementType)) {

test/SILGen/pack_expansion_type.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ func variadicMetatypes<each T>(_: repeat each T) {
4646
// CHECK-LABEL: sil [ossa] @$s19pack_expansion_type18sameExpansionTwice2us05more_G02vsyxxQp_xxQpq_q_QptRvzRv_r0_lF : $@convention(thin) <each U, each V> (@pack_guaranteed Pack{repeat each U}, @pack_guaranteed Pack{repeat each U}, @pack_guaranteed Pack{repeat each V}) -> () {
4747
public func sameExpansionTwice<each U, each V>(us: repeat each U, more_us: repeat each U, vs: repeat each V) {}
4848

49+
// SILVerifier bug
50+
public func nonPackAndPackParameterInExpansion<each T, U, V>(t: repeat each T, u: U, v: V) -> (repeat (each T, U, V)) {
51+
return (repeat (each t, u, v))
52+
}

0 commit comments

Comments
 (0)