diff options
-rw-r--r-- | src/dotty/tools/dotc/typer/Checking.scala | 2 | ||||
-rw-r--r-- | test/dotc/tests.scala | 9 | ||||
-rw-r--r-- | tests/neg/t0273.scala (renamed from tests/pos/t0273.scala) | 0 | ||||
-rw-r--r-- | tests/pos/overloaded.scala | 14 |
4 files changed, 13 insertions, 12 deletions
diff --git a/src/dotty/tools/dotc/typer/Checking.scala b/src/dotty/tools/dotc/typer/Checking.scala index a81e4079a..36822cb85 100644 --- a/src/dotty/tools/dotc/typer/Checking.scala +++ b/src/dotty/tools/dotc/typer/Checking.scala @@ -124,7 +124,7 @@ trait Checking extends NoChecking { for (decl <- cls.info.decls) { for (other <- seen(decl.name)) { typr.println(i"conflict? $decl $other") - if (decl.signature == other.signature) { + if (decl.signature matches other.signature) { def doubleDefError(decl: Symbol, other: Symbol): Unit = { def ofType = if (decl.isType) "" else i": ${other.info}" def explanation = diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index 4b52b93c2..ed6f3b5d9 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -53,15 +53,16 @@ class tests extends CompilerTest { @Test def neg_typedapply() = compileFile(negDir, "typedapply", xerrors = 4) @Test def neg_typedidents() = compileFile(negDir, "typedIdents", xerrors = 2) @Test def neg_assignments() = compileFile(negDir, "assignments", xerrors = 3) - @Test def neg_typers() = compileFile(negDir, "typers", xerrors = 6) + @Test def neg_typers() = compileFile(negDir, "typers", xerrors = 10) @Test def neg_privates() = compileFile(negDir, "privates", xerrors = 2) @Test def neg_rootImports = compileFile(negDir, "rootImplicits", xerrors = 2) @Test def neg_templateParents() = compileFile(negDir, "templateParents", xerrors = 3) - @Test def neg_i39 = compileFile(negDir, "i39", xerrors = 1) - @Test def neg_i50_volatile = compileFile(negDir, "i50-volatile", xerrors = 4) - @Test def neg_companions = compileFile(negDir, "companions", xerrors = 1) @Test def neg_autoTupling = compileFile(posDir, "autoTuplingTest", "-language:noAutoTupling" :: Nil, xerrors = 3) @Test def neg_autoTupling2 = compileFile(negDir, "autoTuplingTest", xerrors = 3) + @Test def neg_companions = compileFile(negDir, "companions", xerrors = 1) + @Test def neg_i39 = compileFile(negDir, "i39", xerrors = 1) + @Test def neg_i50_volatile = compileFile(negDir, "i50-volatile", xerrors = 4) + @Test def neg_t0273_doubledefs = compileFile(negDir, "t0273", xerrors = 1) @Test def neg_t0654_polyalias = compileFile(negDir, "t0654", xerrors = 2) @Test def neg_t1192_legalPrefix = compileFile(negDir, "t1192", xerrors = 1) diff --git a/tests/pos/t0273.scala b/tests/neg/t0273.scala index 10f426828..10f426828 100644 --- a/tests/pos/t0273.scala +++ b/tests/neg/t0273.scala diff --git a/tests/pos/overloaded.scala b/tests/pos/overloaded.scala index ebc1501d8..a26b9b859 100644 --- a/tests/pos/overloaded.scala +++ b/tests/pos/overloaded.scala @@ -2,23 +2,23 @@ object overloaded { def f(x: String): String = x def f[T >: Null](x: T): Int = 1 - + val x1 = f("abc") val x2 = f(new Integer(1)) val x3 = f(null) - + val x4: String => String = f val x5: String => Any = f val x6: Any = f _ - + def g(): Int = 1 def g(x: Int): Int = 2 - + val y1: Int => Int = g - val y2: Any = g _ - + val y2: Any = g _ + println(g) - + val xs = List("a", "b") xs.mkString } |