mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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.
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user