Skip to content

Commit a362084

Browse files
committed
Don't generate an accessor for outerParamAccessors
1 parent 5674066 commit a362084

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

compiler/src/dotty/tools/dotc/transform/Constructors.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ class Constructors extends MiniPhase with IdentityDenotTransformer { thisPhase =
177177
) &&
178178
fn.symbol.info.resultType.classSymbol == outerParam.info.classSymbol =>
179179
ref(outerParam)
180+
case tree: RefTree if tree.symbol.is(ParamAccessor) && tree.symbol.name == nme.OUTER =>
181+
ref(outerParam)
180182
case _ =>
181183
super.transform(tree)
182184
}

compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
package dotty.tools.dotc
1+
package dotty.tools
2+
package dotc
23
package transform
34

45
import MegaPhase._
@@ -178,7 +179,7 @@ object ExplicitOuter {
178179

179180
/** A new param accessor for the outer field in class `cls` */
180181
private def newOuterParamAccessor(cls: ClassSymbol)(implicit ctx: Context) =
181-
newOuterSym(cls, cls, nme.OUTER, Private | ParamAccessor)
182+
newOuterSym(cls, cls, nme.OUTER, Private | Local | ParamAccessor)
182183

183184
/** A new outer accessor for class `cls` which is a member of `owner` */
184185
private def newOuterAccessor(owner: ClassSymbol, cls: ClassSymbol)(implicit ctx: Context) = {

0 commit comments

Comments
 (0)