File tree 2 files changed +12
-14
lines changed
compiler/src/dotty/tools/dotc/transform
2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -104,15 +104,13 @@ class Bridges(root: ClassSymbol)(implicit ctx: Context) {
104
104
/** Add all necessary bridges to template statements `stats`, and remove at the same
105
105
* time deferred methods in `stats` that are replaced by a bridge with the same signature.
106
106
*/
107
- def add (stats : List [untpd.Tree ]): List [untpd.Tree ] =
108
- if (root.is(Trait )) stats
109
- else {
110
- val opc = new BridgesCursor ()(preErasureCtx)
111
- while (opc.hasNext) {
112
- if (! opc.overriding.is(Deferred )) addBridgeIfNeeded(opc.overriding, opc.overridden)
113
- opc.next()
114
- }
115
- if (bridges.isEmpty) stats
116
- else stats.filterNot(stat => toBeRemoved contains stat.symbol) ::: bridges.toList
107
+ def add (stats : List [untpd.Tree ]): List [untpd.Tree ] = {
108
+ val opc = new BridgesCursor ()(preErasureCtx)
109
+ while (opc.hasNext) {
110
+ if (! opc.overriding.is(Deferred )) addBridgeIfNeeded(opc.overriding, opc.overridden)
111
+ opc.next()
117
112
}
118
- }
113
+ if (bridges.isEmpty) stats
114
+ else stats.filterNot(stat => toBeRemoved contains stat.symbol) ::: bridges.toList
115
+ }
116
+ }
Original file line number Diff line number Diff line change @@ -665,7 +665,7 @@ object Erasure {
665
665
}
666
666
}
667
667
668
- override def typedTypeDef (tdef : untpd.TypeDef , sym : Symbol )(implicit ctx : Context ) =
668
+ override def typedTypeDef (tdef : untpd.TypeDef , sym : Symbol )(implicit ctx : Context ): Tree =
669
669
EmptyTree
670
670
671
671
override def typedStats (stats : List [untpd.Tree ], exprOwner : Symbol )(implicit ctx : Context ): List [Tree ] = {
@@ -684,8 +684,8 @@ object Erasure {
684
684
}
685
685
686
686
override def simplify (tree : Tree , pt : Type , locked : TypeVars )(implicit ctx : Context ): tree.type = tree
687
- }
687
+ }
688
688
689
- def takesBridges (sym : Symbol )(implicit ctx : Context ) =
689
+ private def takesBridges (sym : Symbol )(implicit ctx : Context ): Boolean =
690
690
sym.isClass && ! sym.is(Flags .Trait | Flags .Package )
691
691
}
You can’t perform that action at this time.
0 commit comments