Skip to content

Commit 14d506a

Browse files
committed
New tests
Added test for previous PR on super accessors. Updated test for #503 to check both inner classes and inner traits.
1 parent 99b9dbd commit 14d506a

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

tests/pos/i503.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ class HelloWorld {
33
object TypeBool;
44

55
class Fct {
6-
def g(x : Int) = TypeBool // breaks.
6+
def g(x : Int) = TypeBool
7+
}
8+
9+
trait Fct2 {
10+
def g(x : Int) = TypeBool
711
}
812
}
913
}

tests/pos/superacc.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// scenario one: supercalls in traits
2+
abstract class C {
3+
def foo: Int = 2
4+
def baz: Int = 2
5+
}
6+
7+
trait T extends C {
8+
override def foo = super.foo + 1
9+
}
10+
11+
12+
// scenario 2: supercalls in nested classes
13+
class D extends C with T {
14+
class I {
15+
val x= D.super.baz
16+
}
17+
}

0 commit comments

Comments
 (0)