File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -6550,7 +6550,19 @@ maybeDiagnoseUnsupportedDifferentiableConversion(ConstraintSystem &cs,
65506550 maybeDiagnoseFunctionRef (unwrappedFnExpr);
65516551 return ;
65526552 }
6553+ } else if (auto conv = dyn_cast<FunctionConversionExpr>(semanticExpr)) {
6554+ // Look through a function conversion that only adds or removes
6555+ // `@Sendable`.
6556+ auto ty1 = conv->getType ()->castTo <AnyFunctionType>();
6557+ auto ty2 = conv->getSubExpr ()->getType ()->castTo <AnyFunctionType>();
6558+
6559+ if (ty1->withExtInfo (ty1->getExtInfo ().withSendable (false ))
6560+ ->isEqual (ty2->withExtInfo (ty2->getExtInfo ().withSendable (false )))) {
6561+ maybeDiagnoseFunctionRef (conv->getSubExpr ()->getSemanticsProvidingExpr ());
6562+ return ;
6563+ }
65536564 }
6565+
65546566 ctx.Diags .diagnose (expr->getLoc (),
65556567 diag::invalid_differentiable_function_conversion_expr);
65566568 };
You can’t perform that action at this time.
0 commit comments