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 1aa1d75 commit 303e263Copy full SHA for 303e263
tests/run/traits-initialization.scala
@@ -0,0 +1,25 @@
1
+trait A {
2
+ var str = ""
3
+ str = "a"
4
+ val s = str += 'A'
5
+ str += '1'
6
+}
7
+
8
+trait B extends A {
9
+ str += 'b'
10
+ override val s = str += 'B'
11
+ str += '2'
12
13
14
+class D extends A {
15
+ str += 'd'
16
+ override val s = str += 'D'
17
+ str += '3'
18
19
20
+object Test extends D with B {
21
+ // should only have 2 fields
22
+ str += 'E'
23
+ def main(args: Array[String]) = assert(str == "aA1dD3bB2E4")
24
+ str += '4'
25
0 commit comments