@@ -1038,8 +1038,8 @@ class TransferNonTransferrableDiagnosticInferrer {
10381038 }
10391039
10401040 static UseDiagnosticInfo
1041- forFunctionArgumentClosure (ApplyIsolationCrossing isolation) {
1042- return {UseDiagnosticInfoKind::FunctionArgumentClosure, isolation};
1041+ forFunctionArgumentClosure (ApplyIsolationCrossing isolation, Type inferredType ) {
1042+ return {UseDiagnosticInfoKind::FunctionArgumentClosure, isolation, inferredType };
10431043 }
10441044
10451045 static UseDiagnosticInfo forFunctionArgumentApplyStronglyTransferred (Type inferredType) {
@@ -1107,8 +1107,9 @@ bool TransferNonTransferrableDiagnosticInferrer::initForIsolatedPartialApply(
11071107 for (auto &p : foundCapturedIsolationCrossing) {
11081108 if (std::get<1 >(p) == opIndex) {
11091109 loc = std::get<0 >(p).getLoc ();
1110+ Type type = std::get<0 >(p).getDecl ()->getInterfaceType ();
11101111 diagnosticInfo =
1111- UseDiagnosticInfo::forFunctionArgumentClosure (std::get<2 >(p));
1112+ UseDiagnosticInfo::forFunctionArgumentClosure (std::get<2 >(p), type );
11121113 return true ;
11131114 }
11141115 }
@@ -1269,7 +1270,7 @@ void TransferNonSendableImpl::emitTransferredNonTransferrableDiagnostics() {
12691270 }
12701271 case UseDiagnosticInfoKind::FunctionArgumentClosure: {
12711272 diagnoseError (astContext, loc, diag::regionbasedisolation_arg_transferred,
1272- op-> get ()-> getType (). getASTType (),
1273+ diagnosticInfo. getType (),
12731274 diagnosticInfo.getIsolationCrossing ().getCalleeIsolation ())
12741275 .highlight (op->getUser ()->getLoc ().getSourceRange ());
12751276 // Only emit the note if our value is different from the function
0 commit comments