diff --git a/src/dotty/tools/dotc/util/Positions.scala b/src/dotty/tools/dotc/util/Positions.scala index 60274c71fd64..c3890cc9a463 100644 --- a/src/dotty/tools/dotc/util/Positions.scala +++ b/src/dotty/tools/dotc/util/Positions.scala @@ -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) } } diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index 468de7243cd2..db5fa85446b5 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -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) diff --git a/tests/neg/clashes.scala b/tests/neg/clashes.scala index 11354706daf9..6c051953d92c 100644 --- a/tests/neg/clashes.scala +++ b/tests/neg/clashes.scala @@ -1,6 +1,6 @@ object Test { class C - type C + type C // error } -object Test +object Test // error diff --git a/tests/neg/t0654.scala b/tests/neg/t0654.scala deleted file mode 100644 index 0d0f2f7deae4..000000000000 --- a/tests/neg/t0654.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test { - class Foo[T] - type C[T] = Foo[_ <: T] // error: parameter type T of type alias does not appear as type argument of the aliased class Foo - val a: C[AnyRef] = new Foo[AnyRef] -}