Skip to content

Commit c66613d

Browse files
committed
Merge pull request #1008 from dotty-staging/fix-sym-positions
Fix off by 2 error for symbol positions
2 parents 08e3f76 + 51c6646 commit c66613d

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

src/dotty/tools/dotc/util/Positions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ object Positions {
158158
}
159159
def toPosition = {
160160
assert(isPosition)
161-
if (this == NoCoord) NoPosition else Position(1 - encoding)
161+
if (this == NoCoord) NoPosition else Position(-1 - encoding)
162162
}
163163
}
164164

test/dotc/tests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class tests extends CompilerTest {
143143
@Test def neg_badAuxConstr = compileFile(negDir, "badAuxConstr", xerrors = 2)
144144
@Test def neg_typetest = compileFile(negDir, "typetest", xerrors = 1)
145145
@Test def neg_t1569_failedAvoid = compileFile(negDir, "t1569-failedAvoid", xerrors = 1)
146-
@Test def neg_clashes = compileFile(negDir, "clashes", xerrors = 3)
146+
@Test def neg_clashes = compileFile(negDir, "clashes", xerrors = 2)
147147
@Test def neg_cycles = compileFile(negDir, "cycles", xerrors = 8)
148148
@Test def neg_boundspropagation = compileFile(negDir, "boundspropagation", xerrors = 5)
149149
@Test def neg_refinedSubtyping = compileFile(negDir, "refinedSubtyping", xerrors = 2)

tests/neg/clashes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
object Test {
22
class C
3-
type C
3+
type C // error
44
}
55

6-
object Test
6+
object Test // error

tests/neg/t0654.scala

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)