aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/pos/i503.scala13
-rw-r--r--tests/pos/superacc.scala17
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/pos/i503.scala b/tests/pos/i503.scala
new file mode 100644
index 000000000..fd25dc979
--- /dev/null
+++ b/tests/pos/i503.scala
@@ -0,0 +1,13 @@
+class HelloWorld {
+ def main(args: Array[String]): Unit = {
+ object TypeBool;
+
+ class Fct {
+ def g(x : Int) = TypeBool
+ }
+
+ trait Fct2 {
+ def g(x : Int) = TypeBool
+ }
+ }
+}
diff --git a/tests/pos/superacc.scala b/tests/pos/superacc.scala
new file mode 100644
index 000000000..91397003d
--- /dev/null
+++ b/tests/pos/superacc.scala
@@ -0,0 +1,17 @@
+// scenario one: supercalls in traits
+abstract class C {
+ def foo: Int = 2
+ def baz: Int = 2
+}
+
+trait T extends C {
+ override def foo = super.foo + 1
+}
+
+
+// scenario 2: supercalls in nested classes
+class D extends C with T {
+ class I {
+ val x= D.super.baz
+ }
+}