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