Skip to content

Commit 4c1c8e6

Browse files
committed
Fix position in constructor call
1 parent f39dbdd commit 4c1c8e6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,8 @@ object Parsers {
14361436
val (impl, missingBody) = template(emptyConstructor)
14371437
impl.parents match {
14381438
case parent :: Nil if missingBody =>
1439-
if (parent.isType) ensureApplied(wrapNew(parent)) else parent
1439+
if (parent.isType) ensureApplied(wrapNew(parent))
1440+
else parent.withPos(Position(start, in.lastOffset))
14401441
case _ =>
14411442
New(impl.withPos(Position(start, in.lastOffset)))
14421443
}

compiler/test-resources/repl/errmsgs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ 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-
| ^^^^^
29-
| found: Inv[Int]
30-
| required: String
28+
| ^^^^^^^^^^
29+
| found: Inv[Int]
30+
| required: String
3131
|
3232
scala> val b: Inv[String] = new Inv(1)
3333
1 | val b: Inv[String] = new Inv(1)

0 commit comments

Comments
 (0)