File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ class Mixin extends MiniPhaseTransform with SymTransformer { thisTransform =>
96
96
97
97
def traitDefs (stats : List [Tree ]): List [Tree ] = {
98
98
val initBuf = new mutable.ListBuffer [Tree ]
99
- stats flatMap {
99
+ stats. flatMap( {
100
100
case stat : DefDef if stat.symbol.isGetter && ! stat.rhs.isEmpty && ! stat.symbol.is(Flags .Lazy ) =>
101
101
// make initializer that has all effects of previous getter,
102
102
// replace getter rhs with empty tree.
@@ -114,7 +114,7 @@ class Mixin extends MiniPhaseTransform with SymTransformer { thisTransform =>
114
114
case stat =>
115
115
initBuf += stat
116
116
Nil
117
- }
117
+ }) ++ initBuf
118
118
}
119
119
120
120
def transformSuper (tree : Tree ): Tree = {
Original file line number Diff line number Diff line change
1
+ Hello
2
+ World
Original file line number Diff line number Diff line change
1
+ trait Hello {
2
+ println(" Hello" )
3
+ val x : Int = 1
4
+ println(" World" )
5
+ }
6
+
7
+ class A extends Hello
8
+
9
+ object Test {
10
+ def main (args : Array [String ]): Unit = {
11
+ new A
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments