Skip to content

Commit c9ecd50

Browse files
committed
Typos.
1 parent d4e86da commit c9ecd50

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

include/swift/AST/Attr.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,8 +1510,6 @@ class DifferentiableAttr final
15101510
FuncDecl *VJPFunction = nullptr;
15111511
/// The differentiation parameters' indices, resolved by the type checker.
15121512
AutoDiffParameterIndices *ParameterIndices = nullptr;
1513-
/// States whether the function is linear (optional).
1514-
bool linear = false;
15151513
/// The trailing where clause, if it exists.
15161514
TrailingWhereClause *WhereClause = nullptr;
15171515
/// The requirements for autodiff associated functions. Resolved by the type

lib/AST/Attr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ DifferentiableAttr::DifferentiableAttr(ASTContext &context, bool implicit,
13371337
Optional<DeclNameWithLoc> vjp,
13381338
ArrayRef<Requirement> requirements)
13391339
: DeclAttribute(DAK_Differentiable, atLoc, baseRange, implicit),
1340-
JVP(std::move(jvp)), VJP(std::move(vjp)), ParameterIndices(indices) {
1340+
JVP(std::move(jvp)), VJP(std::move(vjp)), ParameterIndices(indices) {
13411341
setRequirements(context, requirements);
13421342
}
13431343

lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ bool Parser::parseDifferentiableAttributeArguments(
986986
} else {
987987
linear = false;
988988
}
989-
989+
990990
// If 'withRespectTo' is used, make the user change it to 'wrt'.
991991
if (Tok.is(tok::identifier) && Tok.getText() == "withRespectTo") {
992992
SourceRange withRespectToRange(Tok.getLoc(), peekToken().getLoc());

test/AutoDiff/differentiable_attr_parse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,4 @@ func const6(_ x: Float) -> (Float, (Float) -> Float) {
164164
@differentiable(wrt: x, vjp: const6, linear) // expected-error {{expected a function specifier label, e.g. 'wrt:', 'jvp:', or 'vjp:'}}
165165
func slope5(_ x: Float) -> Float {
166166
return 6 * x
167-
}
167+
}

0 commit comments

Comments
 (0)