Skip to content

Commit 2947962

Browse files
author
Eli Friedman
committed
Fix getLoc() for DotSyntaxCallExpr.
Swift SVN r1999
1 parent fe96897 commit 2947962

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/swift/AST/Expr.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,9 +1578,11 @@ class DotSyntaxCallExpr : public ThisApplyExpr {
15781578
}
15791579

15801580
SourceLoc getDotLoc() const { return DotLoc; }
1581-
SourceLoc getLoc() const { return getArg()->getStartLoc(); }
1581+
SourceLoc getLoc() const {
1582+
return DotLoc.isValid() ? getArg()->getStartLoc() : getFn()->getStartLoc();
1583+
}
15821584
SourceLoc getEndLoc() const {
1583-
return DotLoc.isValid()? getFn()->getEndLoc() : getArg()->getEndLoc();
1585+
return getFn()->getEndLoc();
15841586
}
15851587

15861588
SourceRange getSourceRange() const {

0 commit comments

Comments
 (0)