Skip to content

Commit 7e61b23

Browse files
committed
Add super calls to trait initialization test)
1 parent 303e263 commit 7e61b23

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/run/traits-initialization.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ trait B extends A {
1111
str += '2'
1212
}
1313

14-
class D extends A {
14+
class D(sup: =>String) extends A {
1515
str += 'd'
1616
override val s = str += 'D'
1717
str += '3'
1818
}
1919

20-
object Test extends D with B {
20+
object Test extends D({Test.str += "Z"; Test.str}) with B {
2121
// should only have 2 fields
2222
str += 'E'
23-
def main(args: Array[String]) = assert(str == "aA1dD3bB2E4")
23+
def main(args: Array[String]) = assert(str == "aA1dD3bB2E4", str)
2424
str += '4'
2525
}

0 commit comments

Comments
 (0)