@@ -619,15 +619,15 @@ bool TypeChecker::diagnoseInvalidFunctionType(FunctionType *fnTy, SourceLoc loc,
619
619
dc, stage);
620
620
}) != params.end ();
621
621
bool alreadyDiagnosedOneParam = false ;
622
- bool hasInoutDifferentiableParameter = false ;
622
+ bool hasDifferentiableInoutParameter = false ;
623
623
for (unsigned i = 0 , end = fnTy->getNumParams (); i != end; ++i) {
624
624
auto param = params[i];
625
625
if (param.isNoDerivative ())
626
626
continue ;
627
627
auto paramType = param.getPlainType ();
628
628
if (TypeChecker::isDifferentiable (paramType, isLinear, dc, stage)) {
629
629
if (param.isInOut ())
630
- hasInoutDifferentiableParameter = true ;
630
+ hasDifferentiableInoutParameter = true ;
631
631
continue ;
632
632
}
633
633
auto diagLoc =
@@ -663,7 +663,7 @@ bool TypeChecker::diagnoseInvalidFunctionType(FunctionType *fnTy, SourceLoc loc,
663
663
bool differentiableResultExists = resultExists && resultIsDifferentiable;
664
664
665
665
// Reject the case where there are multiple semantic results.
666
- if (differentiableResultExists && hasInoutDifferentiableParameter ) {
666
+ if (differentiableResultExists && hasDifferentiableInoutParameter ) {
667
667
auto diagLoc = repr ? (*repr)->getArgsTypeRepr ()->getLoc () : loc;
668
668
auto diag = ctx.Diags .diagnose (
669
669
diagLoc,
@@ -676,7 +676,7 @@ bool TypeChecker::diagnoseInvalidFunctionType(FunctionType *fnTy, SourceLoc loc,
676
676
}
677
677
678
678
// Reject the case where the semantic result is not differentiable.
679
- if (!resultIsDifferentiable && !hasInoutDifferentiableParameter ) {
679
+ if (!resultIsDifferentiable && !hasDifferentiableInoutParameter ) {
680
680
auto diagLoc = repr ? (*repr)->getResultTypeRepr ()->getLoc () : loc;
681
681
auto resultStr = fnTy->getResult ()->getString ();
682
682
auto diag = ctx.Diags .diagnose (
@@ -690,7 +690,7 @@ bool TypeChecker::diagnoseInvalidFunctionType(FunctionType *fnTy, SourceLoc loc,
690
690
}
691
691
692
692
// Reject the case where there are no semantic results.
693
- if (!resultExists && !hasInoutDifferentiableParameter ) {
693
+ if (!resultExists && !hasDifferentiableInoutParameter ) {
694
694
auto diagLoc = repr ? (*repr)->getResultTypeRepr ()->getLoc () : loc;
695
695
auto diag = ctx.Diags .diagnose (
696
696
diagLoc, diag::differentiable_function_type_no_differentiable_result,
0 commit comments