Skip to content

Commit 8ac0e64

Browse files
committed
enable ReadPositions when Ysemanticdb is set
1 parent 5f43d09 commit 8ac0e64

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ class Compiler {
146146

147147
def newRun(implicit ctx: Context): Run = {
148148
reset()
149-
new Run(this, ctx)
149+
val rctx =
150+
if ctx.settings.Ysemanticdb.value
151+
ctx.addMode(Mode.ReadPositions)
152+
else
153+
ctx
154+
new Run(this, rctx)
150155
}
151156
}

tests/neg/mixin-forwarder-clash2.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
1 |class Bar2 extends Bar1 with Two[Foo] // error
44
| ^
55
| Name clash between inherited members:
6-
| def concat(suffix: Int): X in trait One and
7-
| def concat: [Dummy](suffix: Int): Y in trait Two
6+
| def concat(suffix: Int): X in trait One at line 4 and
7+
| def concat: [Dummy](suffix: Int): Y in trait Two at line 8
88
| have the same type after erasure.

0 commit comments

Comments
 (0)