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
107107
108108 /** Type of a reference implies that it needs to be hoisted */
109109 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)
111111 case tp : TermRef => refNeedsHoist(tp.prefix)
112112 case _ => false
113113 }
114114
115115 /** Super call argument is complex, needs to be hoisted */
116- def needsHoist (tree : Tree ) = tree match {
116+ def needsHoist (tree : Tree ) = tree match
117117 case _ : DefDef => true
118118 case _ : Template => true
119119 case _ : New => ! tree.tpe.typeSymbol.isStatic
120120 case _ : RefTree | _ : This => refNeedsHoist(tree.tpe)
121121 case _ => false
122- }
123122
124123 /** Only rewire types that are owned by the current Hoister and is an param or accessor */
125124 def needsRewire (tp : Type ) = tp match {
You can’t perform that action at this time.
0 commit comments