aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/customArgs/overloadsOnAbstractTypes.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/neg/customArgs/overloadsOnAbstractTypes.scala')
-rw-r--r--tests/neg/customArgs/overloadsOnAbstractTypes.scala22
1 files changed, 22 insertions, 0 deletions
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
+}