Skip to content

Commit c02787d

Browse files
committed
SILGen: Don't explode inout tuples in init allocating entry points.
rdar://problem/51302498
1 parent 83f86f5 commit c02787d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/SILGen/SILGenProlog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ static void makeArgument(Type ty, ParamDecl *decl,
311311
SmallVectorImpl<SILValue> &args, SILGenFunction &SGF) {
312312
assert(ty && "no type?!");
313313

314-
// Destructure tuple arguments.
315-
if (TupleType *tupleTy = ty->getAs<TupleType>()) {
314+
// Destructure tuple value arguments.
315+
if (TupleType *tupleTy = decl->isInOut() ? nullptr : ty->getAs<TupleType>()) {
316316
for (auto fieldType : tupleTy->getElementTypes())
317317
makeArgument(fieldType, decl, args, SGF);
318318
} else {

test/SILGen/initializers.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,3 +1147,10 @@ extension MemberInits {
11471147
// CHECK-NEXT: = apply [[INIT_FN]]<Array<T>>() : $@convention(thin) <τ_0_0 where τ_0_0 : Equatable> () -> @owned String
11481148
}
11491149
}
1150+
1151+
// rdar://problem/51302498
1152+
1153+
class Butt {
1154+
init(foo: inout (Int, Int)) { }
1155+
}
1156+

0 commit comments

Comments
 (0)