Skip to content

Commit c8565c8

Browse files
authored
Merge pull request #40930 from jckarter/loadable-by-address-fix-subst-return-type-rewrite-5.6
[5.6] LoadableByAddress: Fix code that changes lowered return type of function.
2 parents 7ae6737 + 158a3ed commit c8565c8

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

lib/IRGen/LoadableByAddress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ static bool rewriteFunctionReturn(StructLoweringState &pass) {
23622362
}
23632363

23642364
auto NewTy = SILFunctionType::get(
2365-
loweredTy->getSubstGenericSignature(),
2365+
loweredTy->getInvocationGenericSignature(),
23662366
loweredTy->getExtInfo(),
23672367
loweredTy->getCoroutineKind(),
23682368
loweredTy->getCalleeConvention(),
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// rdar://87792152
2+
// RUN: %target-swift-frontend -disable-availability-checking -emit-ir -verify %s
3+
4+
public struct S1 {
5+
var a: Int?
6+
var b: Int?
7+
var c: Int?
8+
}
9+
10+
public struct S2 {
11+
public func foo() {
12+
_ = bar
13+
}
14+
15+
func bar(_: S1) -> some Any {
16+
return 0
17+
}
18+
}

0 commit comments

Comments
 (0)