@@ -640,7 +640,7 @@ bool TypeChecker::diagnoseInvalidFunctionType(FunctionType *fnTy, SourceLoc loc,
640
640
if (hasValidDifferentiabilityParam)
641
641
diagnostic.fixItInsert (diagLoc, " @noDerivative " );
642
642
}
643
-
643
+
644
644
// Reject the case where all parameters have '@noDerivative'.
645
645
if (!alreadyDiagnosedOneParam && !hasValidDifferentiabilityParam) {
646
646
auto diagLoc = repr ? (*repr)->getArgsTypeRepr ()->getLoc () : loc;
@@ -659,20 +659,20 @@ bool TypeChecker::diagnoseInvalidFunctionType(FunctionType *fnTy, SourceLoc loc,
659
659
bool resultIsDifferentiable =
660
660
isDifferentiable (result, /* tangentVectorEqualsSelf*/ isLinear, dc,
661
661
stage);
662
-
662
+
663
663
// Reject the case where there are multiple semantic results.
664
664
if (resultIsDifferentiable && hasInoutDiffParameter) {
665
665
auto diagLoc = repr ? (*repr)->getArgsTypeRepr ()->getLoc () : loc;
666
666
auto diag = ctx.Diags .diagnose (
667
667
diagLoc,
668
668
diag::differentiable_function_type_multiple_semantic_results);
669
669
hadAnyError = true ;
670
-
670
+
671
671
if (repr) {
672
672
diag.highlight ((*repr)->getSourceRange ());
673
673
}
674
674
}
675
-
675
+
676
676
// Reject the case where there are no semantic results.
677
677
if (!resultIsDifferentiable && !hasInoutDiffParameter) {
678
678
auto diagLoc = repr ? (*repr)->getResultTypeRepr ()->getLoc () : loc;
@@ -681,7 +681,7 @@ bool TypeChecker::diagnoseInvalidFunctionType(FunctionType *fnTy, SourceLoc loc,
681
681
diagLoc, diag::differentiable_function_type_invalid_result, resultStr,
682
682
isLinear);
683
683
hadAnyError = true ;
684
-
684
+
685
685
if (repr) {
686
686
diag.highlight ((*repr)->getResultTypeRepr ()->getSourceRange ());
687
687
}
0 commit comments