File tree Expand file tree Collapse file tree 3 files changed +49
-5
lines changed
test/files/trait-defaults Expand file tree Collapse file tree 3 files changed +49
-5
lines changed Original file line number Diff line number Diff line change 1
1
trait T {
2
- private [this ] val f = 1
3
- }
2
+ val abs : String
3
+ protected val protabs : String
4
+ val pub = " public"
5
+ protected val prot = " protected"
6
+ private val privvy = " private"
7
+ private [this ] val privateThis = " private[this]"
8
+
9
+ trait Nested { println(abs + privateThis) }
10
+
11
+ object NO {
12
+ println(abs)
13
+ println(pub)
14
+ println(prot)
15
+ println(protabs)
16
+ println(privvy)
17
+ println(privateThis)
18
+ }
19
+
20
+ trait NT {
21
+ println(abs)
22
+ println(pub)
23
+ println(prot)
24
+ println(protabs)
25
+ println(privvy)
26
+ println(privateThis)
27
+ }
28
+
29
+ class NC {
30
+ println(abs)
31
+ println(pub)
32
+ println(prot)
33
+ println(protabs)
34
+ println(privvy)
35
+ println(privateThis)
36
+ }
37
+ }
38
+
39
+ class C extends T {
40
+ val abs = " abstract"
41
+ val protabs = " abstract protected"
42
+ }
43
+
44
+ object Test extends C with App
Original file line number Diff line number Diff line change 1
1
trait T {
2
+ lazy val laze = {println(" a" ); 1 }
3
+
2
4
val a = 1
3
5
println(" " )
4
6
val b = 2
5
7
println(a+ b)
6
8
}
9
+
10
+
11
+ class C extends T
Original file line number Diff line number Diff line change @@ -2,6 +2,4 @@ trait NestedObj {
2
2
object O { println(" NO" ) }
3
3
}
4
4
5
- class C extends NestedObj {
6
- def O = ???
7
- }
5
+ class C extends NestedObj
You can’t perform that action at this time.
0 commit comments