Skip to content

Commit 80e43fb

Browse files
authored
Merge pull request #68399 from slavapestov/fix-rdar114823719
SILGen: Use the right abstraction pattern when loading 'async let' result
2 parents c75aea3 + 583c51a commit 80e43fb

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

lib/SILGen/SILGenApply.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7023,11 +7023,10 @@ ManagedValue SILGenFunction::emitReadAsyncLetBinding(SILLocation loc,
70237023
assert(visitor.varAddr && "didn't find var in pattern?");
70247024

70257025
// Load and reabstract the value if needed.
7026-
auto genericSig = F.getLoweredFunctionType()->getInvocationGenericSignature();
70277026
auto substVarTy = var->getTypeInContext()->getCanonicalType();
7028-
auto substAbstraction = AbstractionPattern(genericSig, substVarTy);
7029-
return emitLoad(loc, visitor.varAddr, substAbstraction, substVarTy,
7030-
getTypeLowering(substAbstraction, substVarTy),
7027+
return emitLoad(loc, visitor.varAddr,
7028+
AbstractionPattern::getOpaque(), substVarTy,
7029+
getTypeLowering(substVarTy),
70317030
SGFContext(), IsNotTake);
70327031
}
70337032

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %target-swift-frontend -emit-silgen %s -disable-availability-checking
2+
// REQUIRES: concurrency
3+
4+
public func callee() async -> (() -> ()) {
5+
fatalError()
6+
}
7+
8+
public func caller() async {
9+
async let future = callee()
10+
let result = await future
11+
result()
12+
}

0 commit comments

Comments
 (0)