Skip to content

Commit 0748eea

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 049eafe commit 0748eea

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
@@ -1494,7 +1494,7 @@ object Parsers {
14941494
}
14951495
if (in.token == LPAREN && (!inClassConstrAnnots || isLegalAnnotArg))
14961496
parArgumentExprss(
1497-
atPos(in.offset) { Apply(fn, parArgumentExprs()) }
1497+
atPos(startOffset(fn)) { Apply(fn, parArgumentExprs()) }
14981498
)
14991499
else fn
15001500
}

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)