Merge pull request #83074 from drexin/wip-155641749

[6.2][IRGen] Set generic context before getting call emission in visitFull…
This commit is contained in:
Dario Rexin
2025-07-21 15:56:30 -07:00
committed by GitHub
2 changed files with 16 additions and 3 deletions

View File

@@ -3850,6 +3850,10 @@ void IRGenSILFunction::visitFullApplySite(FullApplySite site) {
}
}
// Lower the arguments and return value in the callee's generic context.
GenericContextScope scope(IGM,
origCalleeType->getInvocationGenericSignature());
Explosion llArgs;
WitnessMetadata witnessMetadata;
auto emission = getCallEmissionForLoweredValue(
@@ -3862,9 +3866,6 @@ void IRGenSILFunction::visitFullApplySite(FullApplySite site) {
emission->begin();
// Lower the arguments and return value in the callee's generic context.
GenericContextScope scope(IGM, origCalleeType->getInvocationGenericSignature());
auto &calleeFP = emission->getCallee().getFunctionPointer();
// Allocate space for the coroutine buffer.

View File

@@ -359,3 +359,15 @@ struct SomeStruct {
func someFunc() async throws(SmallError) -> SomeStruct {
SomeStruct(x: 42, y: 23, z: 25)
}
// Used to crash the compiler -- https://github.com/swiftlang/swift/issues/80732
protocol PAssoc<T>: AnyObject {
associatedtype T
func foo() async throws(SmallError) -> (any PAssoc<T>)
}
class MyProtocolImpl<T>: PAssoc {
func foo() async throws(SmallError) -> (any PAssoc<T>) {
fatalError()
}
}