aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2017-04-13 12:34:38 +0200
committerGitHub <noreply@github.com>2017-04-13 12:34:38 +0200
commit742f881ddbc95669abe78aa76f7981fd0f821db6 (patch)
tree695326e19db4a5ed01b6a41330d125d776531b26
parent6b041ee7b5df98a84c3fbf31b8392fe77152529d (diff)
parent25b5705d4183191b642f520e5ab3bc635f0ddde3 (diff)
downloaddotty-742f881ddbc95669abe78aa76f7981fd0f821db6.zip
dotty-742f881ddbc95669abe78aa76f7981fd0f821db6.tar.gz
dotty-742f881ddbc95669abe78aa76f7981fd0f821db6.tar.bz2
Merge pull request #2231 from dotty-staging/fix-#2230
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 ff50d72..cf9b200 100644
--- a/compiler/test/dotty/tools/dotc/CompilationTests.scala
+++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala
@@ -156,6 +156,7 @@ class CompilationTests extends 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
+}