We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e61b23 commit 6c276dcCopy full SHA for 6c276dc
tests/run/traits-initialization.scala
@@ -1,6 +1,11 @@
1
+object store {
2
+ var str = ""
3
+}
4
+
5
+import store._
6
7
trait A {
- var str = ""
- str = "a"
8
+ str += "a"
9
val s = str += 'A'
10
str += '1'
11
}
@@ -11,15 +16,16 @@ trait B extends A {
16
str += '2'
12
17
13
18
14
-class D(sup: =>String) extends A {
19
+class D(sup: Unit) extends A {
15
20
str += 'd'
21
override val s = str += 'D'
22
str += '3'
23
24
-object Test extends D({Test.str += "Z"; Test.str}) with B {
25
26
+object Test extends D({str += "Z"}) with B {
27
// should only have 2 fields
28
str += 'E'
- def main(args: Array[String]) = assert(str == "aA1dD3bB2E4", str)
29
+ def main(args: Array[String]) = assert(str == "ZaA1dD3bB2E4", str)
30
str += '4'
31
0 commit comments