Skip to content

Fix off by 2 error for symbol positions #1008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/util/Positions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ object Positions {
}
def toPosition = {
assert(isPosition)
if (this == NoCoord) NoPosition else Position(1 - encoding)
if (this == NoCoord) NoPosition else Position(-1 - encoding)
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/dotc/tests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class tests extends CompilerTest {
@Test def neg_badAuxConstr = compileFile(negDir, "badAuxConstr", xerrors = 2)
@Test def neg_typetest = compileFile(negDir, "typetest", xerrors = 1)
@Test def neg_t1569_failedAvoid = compileFile(negDir, "t1569-failedAvoid", xerrors = 1)
@Test def neg_clashes = compileFile(negDir, "clashes", xerrors = 3)
@Test def neg_clashes = compileFile(negDir, "clashes", xerrors = 2)
@Test def neg_cycles = compileFile(negDir, "cycles", xerrors = 8)
@Test def neg_boundspropagation = compileFile(negDir, "boundspropagation", xerrors = 5)
@Test def neg_refinedSubtyping = compileFile(negDir, "refinedSubtyping", xerrors = 2)
Expand Down
4 changes: 2 additions & 2 deletions tests/neg/clashes.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
object Test {
class C
type C
type C // error
}

object Test
object Test // error
5 changes: 0 additions & 5 deletions tests/neg/t0654.scala

This file was deleted.