Skip to content

Commit d164736

Browse files
authored
Merge pull request #10816 from CodaFi/inout-of-the-blue
[NFC] Remove dead lowering path for inout elements of tuple parameters
2 parents 8793212 + 494c68e commit d164736

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

lib/SIL/TypeLowering.cpp

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,20 +1441,14 @@ static CanTupleType getLoweredTupleType(TypeConverter &tc,
14411441

14421442
assert(!isa<LValueType>(substEltType) &&
14431443
"lvalue types cannot exist in function signatures");
1444-
1445-
CanType loweredSubstEltType;
1446-
if (auto substLV = dyn_cast<InOutType>(substEltType)) {
1447-
SILType silType = tc.getLoweredType(origType.getWithoutSpecifierType(),
1448-
substLV.getObjectType());
1449-
loweredSubstEltType = CanInOutType::get(silType.getSwiftRValueType());
1450-
1451-
} else {
1452-
// If the original type was an archetype, use that archetype as
1453-
// the original type of the element --- the actual archetype
1454-
// doesn't matter, just the abstraction pattern.
1455-
SILType silType = tc.getLoweredType(origEltType, substEltType);
1456-
loweredSubstEltType = silType.getSwiftRValueType();
1457-
}
1444+
assert(!isa<InOutType>(substEltType) &&
1445+
"inout cannot appear in tuple element type here");
1446+
1447+
// If the original type was an archetype, use that archetype as
1448+
// the original type of the element --- the actual archetype
1449+
// doesn't matter, just the abstraction pattern.
1450+
SILType silType = tc.getLoweredType(origEltType, substEltType);
1451+
CanType loweredSubstEltType = silType.getSwiftRValueType();
14581452

14591453
changed = (changed || substEltType != loweredSubstEltType);
14601454

0 commit comments

Comments
 (0)