Skip to content

Commit 20d7701

Browse files
authored
Merge pull request #13172 from gottesmm/pr-99b23ece87bbb2aff6590a2488b6179dfd5ff517
2 parents 35133fe + 497b62d commit 20d7701

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/SILGen/SILGenPoly.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2924,7 +2924,7 @@ static ManagedValue createThunk(SILGenFunction &SGF,
29242924
SingleValueInstruction *thunkedFn =
29252925
SGF.B.createPartialApply(loc, thunkValue,
29262926
SILType::getPrimitiveObjectType(substFnType),
2927-
subs, fn.forward(SGF),
2927+
subs, fn.ensurePlusOne(SGF, loc).forward(SGF),
29282928
SILType::getPrimitiveObjectType(expectedType));
29292929
if (expectedType->isNoEscape()) {
29302930
thunkedFn = SGF.B.createConvertFunction(loc, thunkedFn,

test/SILGen/guaranteed_normal_args.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ struct Buffer {
2929

3030
typealias AnyObject = Builtin.AnyObject
3131

32+
protocol Protocol {
33+
associatedtype AssocType
34+
static func useInput(_ input: Builtin.Int32, into processInput: (AssocType) -> ())
35+
}
36+
3237
///////////
3338
// Tests //
3439
///////////
@@ -86,3 +91,11 @@ struct StructContainingBridgeObject {
8691
rawValue = Builtin.reinterpretCast(swiftObj)
8792
}
8893
}
94+
95+
struct ReabstractionThunkTest : Protocol {
96+
typealias AssocType = Builtin.Int32
97+
98+
static func useInput(_ input: Builtin.Int32, into processInput: (AssocType) -> ()) {
99+
processInput(input)
100+
}
101+
}

0 commit comments

Comments
 (0)