Skip to content

Commit 56857f6

Browse files
smarterallanrenucci
authored andcommitted
Fix position of parsed applications
The end position was correctly set but the start position was wrong: the start position of `fn(args)` should be the same as the start position of `fn` itself.
1 parent 7c4a94f commit 56857f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ object Parsers {
15331533
}
15341534
if (in.token == LPAREN && (!inClassConstrAnnots || isLegalAnnotArg))
15351535
parArgumentExprss(
1536-
atPos(in.offset) { Apply(fn, parArgumentExprs()) }
1536+
atPos(startOffset(fn)) { Apply(fn, parArgumentExprs()) }
15371537
)
15381538
else fn
15391539
}

compiler/test-resources/repl/errmsgs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ scala> val z: (List[String], List[Int]) = (List(1), List("a"))
2525
|
2626
scala> val a: Inv[String] = new Inv(new Inv(1))
2727
1 | val a: Inv[String] = new Inv(new Inv(1))
28-
| ^^^^^
28+
| ^^^^^^
2929
| found: Inv[Int]
3030
| required: String
3131
|

0 commit comments

Comments
 (0)