@@ -809,11 +809,11 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
809
809
val parents1 = ensureConstrCall(ensureFirstIsClass(
810
810
parents mapconserve typedParent, cdef.pos.toSynthetic))
811
811
val self1 = typed(self)(ctx.outer).asInstanceOf [ValDef ] // outer context where class memebers are not visible
812
- val localDummy = ctx.newLocalDummy (cls, impl.pos )
813
- val body1 = typedStats(body, localDummy )(inClassContext(self1.symbol))
812
+ val dummy = localDummy (cls, impl)
813
+ val body1 = typedStats(body, dummy )(inClassContext(self1.symbol))
814
814
checkNoDoubleDefs(cls)
815
815
val impl1 = cpy.Template (impl, constr1, parents1, self1, body1)
816
- .withType(localDummy .termRef)
816
+ .withType(dummy .termRef)
817
817
assignType(cpy.TypeDef (cdef, mods1, name, impl1), cls)
818
818
819
819
// todo later: check that
@@ -825,6 +825,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
825
825
// 4. Polymorphic type defs override nothing.
826
826
}
827
827
828
+ def localDummy (cls : ClassSymbol , impl : untpd.Template )(implicit ctx : Context ): Symbol =
829
+ ctx.newLocalDummy(cls, impl.pos)
830
+
828
831
def typedImport (imp : untpd.Import , sym : Symbol )(implicit ctx : Context ): Import = track(" typedImport" ) {
829
832
val expr1 = typedExpr(imp.expr, AnySelectionProto )
830
833
checkStable(expr1.tpe, imp.expr.pos)
0 commit comments