Skip to content

Commit 4b8312d

Browse files
committed
Modify spelling and whitespace
1 parent c11f5ce commit 4b8312d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/swift/AST/AutoDiff.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ class TangentSpace {
365365
return {Kind::TangentVector, tangentVectorType};
366366
}
367367
static TangentSpace getTuple(TupleType *tupleTy) {
368-
return {Kind::Tuple, tupleTy};
369-
}
368+
return {Kind::Tuple, tupleTy};
369+
}
370370

371371
bool isTangentVector() const { return kind == Kind::TangentVector; }
372372
bool isTuple() const { return kind == Kind::Tuple; }

lib/Sema/TypeChecker.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -619,15 +619,15 @@ bool TypeChecker::diagnoseInvalidFunctionType(FunctionType *fnTy, SourceLoc loc,
619619
dc, stage);
620620
}) != params.end();
621621
bool alreadyDiagnosedOneParam = false;
622-
bool hasInoutDifferentiableParameter = false;
622+
bool hasDifferentiableInoutParameter = false;
623623
for (unsigned i = 0, end = fnTy->getNumParams(); i != end; ++i) {
624624
auto param = params[i];
625625
if (param.isNoDerivative())
626626
continue;
627627
auto paramType = param.getPlainType();
628628
if (TypeChecker::isDifferentiable(paramType, isLinear, dc, stage)) {
629629
if (param.isInOut())
630-
hasInoutDifferentiableParameter = true;
630+
hasDifferentiableInoutParameter = true;
631631
continue;
632632
}
633633
auto diagLoc =
@@ -663,7 +663,7 @@ bool TypeChecker::diagnoseInvalidFunctionType(FunctionType *fnTy, SourceLoc loc,
663663
bool differentiableResultExists = resultExists && resultIsDifferentiable;
664664

665665
// Reject the case where there are multiple semantic results.
666-
if (differentiableResultExists && hasInoutDifferentiableParameter) {
666+
if (differentiableResultExists && hasDifferentiableInoutParameter) {
667667
auto diagLoc = repr ? (*repr)->getArgsTypeRepr()->getLoc() : loc;
668668
auto diag = ctx.Diags.diagnose(
669669
diagLoc,
@@ -676,7 +676,7 @@ bool TypeChecker::diagnoseInvalidFunctionType(FunctionType *fnTy, SourceLoc loc,
676676
}
677677

678678
// Reject the case where the semantic result is not differentiable.
679-
if (!resultIsDifferentiable && !hasInoutDifferentiableParameter) {
679+
if (!resultIsDifferentiable && !hasDifferentiableInoutParameter) {
680680
auto diagLoc = repr ? (*repr)->getResultTypeRepr()->getLoc() : loc;
681681
auto resultStr = fnTy->getResult()->getString();
682682
auto diag = ctx.Diags.diagnose(
@@ -690,7 +690,7 @@ bool TypeChecker::diagnoseInvalidFunctionType(FunctionType *fnTy, SourceLoc loc,
690690
}
691691

692692
// Reject the case where there are no semantic results.
693-
if (!resultExists && !hasInoutDifferentiableParameter) {
693+
if (!resultExists && !hasDifferentiableInoutParameter) {
694694
auto diagLoc = repr ? (*repr)->getResultTypeRepr()->getLoc() : loc;
695695
auto diag = ctx.Diags.diagnose(
696696
diagLoc, diag::differentiable_function_type_no_differentiable_result,

0 commit comments

Comments
 (0)