aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Stucki <nicolas.stucki@gmail.com>2017-04-11 22:26:04 +0200
committerNicolas Stucki <nicolas.stucki@gmail.com>2017-04-12 07:38:35 +0200
commit25b5705d4183191b642f520e5ab3bc635f0ddde3 (patch)
treeead570d48c7afe38b5bcb32c4df9d8dfa4cbe7a6
parent10a1300b7599407a7c6078244c4b7692e339b39f (diff)
downloaddotty-25b5705d4183191b642f520e5ab3bc635f0ddde3.zip
dotty-25b5705d4183191b642f520e5ab3bc635f0ddde3.tar.gz
dotty-25b5705d4183191b642f520e5ab3bc635f0ddde3.tar.bz2
Fix #2230: Add regression test.
-rw-r--r--compiler/test/dotty/tools/dotc/CompilationTests.scala1
-rw-r--r--tests/neg/customArgs/overloadsOnAbstractTypes.scala22
2 files changed, 23 insertions, 0 deletions
diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala
index 742b93f..b3604d3 100644
--- a/compiler/test/dotty/tools/dotc/CompilationTests.scala
+++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala
@@ -151,6 +151,7 @@ class CompilationTests extends ParallelSummaryReport with ParallelTesting {
compileFile("../tests/neg/customArgs/nopredef.scala", defaultOptions.and("-Yno-predef")) +
compileFile("../tests/neg/customArgs/noimports.scala", defaultOptions.and("-Yno-imports")) +
compileFile("../tests/neg/customArgs/noimports2.scala", defaultOptions.and("-Yno-imports")) +
+ compileFile("../tests/neg/customArgs/overloadsOnAbstractTypes.scala", allowDoubleBindings) +
compileFile("../tests/neg/tailcall/t1672b.scala", defaultOptions) +
compileFile("../tests/neg/tailcall/t3275.scala", defaultOptions) +
compileFile("../tests/neg/tailcall/t6574.scala", defaultOptions) +
diff --git a/tests/neg/customArgs/overloadsOnAbstractTypes.scala b/tests/neg/customArgs/overloadsOnAbstractTypes.scala
new file mode 100644
index 0000000..0c9ed12
--- /dev/null
+++ b/tests/neg/customArgs/overloadsOnAbstractTypes.scala
@@ -0,0 +1,22 @@
+
+class Test1 {
+ type A
+ type B <: A
+
+ def foo(): A = ???
+ def foo(): A = ??? // error
+
+ def bar(): A = ???
+ def bar(): B = ??? // error
+}
+
+class Test2 {
+ type A
+ type B <: A
+
+ def foo(x: A) = ???
+ def foo(x: A) = ??? // error
+
+ def bar(x: A) = ???
+ def bar(x: B) = ??? // error
+}