@@ -1038,8 +1038,8 @@ class TransferNonTransferrableDiagnosticInferrer {
1038
1038
}
1039
1039
1040
1040
static UseDiagnosticInfo
1041
- forFunctionArgumentClosure (ApplyIsolationCrossing isolation) {
1042
- return {UseDiagnosticInfoKind::FunctionArgumentClosure, isolation};
1041
+ forFunctionArgumentClosure (ApplyIsolationCrossing isolation, Type inferredType ) {
1042
+ return {UseDiagnosticInfoKind::FunctionArgumentClosure, isolation, inferredType };
1043
1043
}
1044
1044
1045
1045
static UseDiagnosticInfo forFunctionArgumentApplyStronglyTransferred (Type inferredType) {
@@ -1107,8 +1107,9 @@ bool TransferNonTransferrableDiagnosticInferrer::initForIsolatedPartialApply(
1107
1107
for (auto &p : foundCapturedIsolationCrossing) {
1108
1108
if (std::get<1 >(p) == opIndex) {
1109
1109
loc = std::get<0 >(p).getLoc ();
1110
+ Type type = std::get<0 >(p).getDecl ()->getInterfaceType ();
1110
1111
diagnosticInfo =
1111
- UseDiagnosticInfo::forFunctionArgumentClosure (std::get<2 >(p));
1112
+ UseDiagnosticInfo::forFunctionArgumentClosure (std::get<2 >(p), type );
1112
1113
return true ;
1113
1114
}
1114
1115
}
@@ -1269,7 +1270,7 @@ void TransferNonSendableImpl::emitTransferredNonTransferrableDiagnostics() {
1269
1270
}
1270
1271
case UseDiagnosticInfoKind::FunctionArgumentClosure: {
1271
1272
diagnoseError (astContext, loc, diag::regionbasedisolation_arg_transferred,
1272
- op-> get ()-> getType (). getASTType (),
1273
+ diagnosticInfo. getType (),
1273
1274
diagnosticInfo.getIsolationCrossing ().getCalleeIsolation ())
1274
1275
.highlight (op->getUser ()->getLoc ().getSourceRange ());
1275
1276
// Only emit the note if our value is different from the function
0 commit comments