File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -107,19 +107,18 @@ class HoistSuperArgs extends MiniPhase with IdentityDenotTransformer { thisPhase
107
107
108
108
/** Type of a reference implies that it needs to be hoisted */
109
109
def refNeedsHoist (tp : Type ): Boolean = tp match {
110
- case tp : ThisType => ! tp.cls.isStaticOwner && tp.cls != cls
110
+ case tp : ThisType => ! tp.cls.isStaticOwner && ! cls.isContainedIn( tp.cls)
111
111
case tp : TermRef => refNeedsHoist(tp.prefix)
112
112
case _ => false
113
113
}
114
114
115
115
/** Super call argument is complex, needs to be hoisted */
116
- def needsHoist (tree : Tree ) = tree match {
116
+ def needsHoist (tree : Tree ) = tree match
117
117
case _ : DefDef => true
118
118
case _ : Template => true
119
119
case _ : New => ! tree.tpe.typeSymbol.isStatic
120
120
case _ : RefTree | _ : This => refNeedsHoist(tree.tpe)
121
121
case _ => false
122
- }
123
122
124
123
/** Only rewire types that are owned by the current Hoister and is an param or accessor */
125
124
def needsRewire (tp : Type ) = tp match {
You can’t perform that action at this time.
0 commit comments