aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 60acda4b7..6e613975b 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -809,11 +809,11 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
val parents1 = ensureConstrCall(ensureFirstIsClass(
parents mapconserve typedParent, cdef.pos.toSynthetic))
val self1 = typed(self)(ctx.outer).asInstanceOf[ValDef] // outer context where class memebers are not visible
- val localDummy = ctx.newLocalDummy(cls, impl.pos)
- val body1 = typedStats(body, localDummy)(inClassContext(self1.symbol))
+ val dummy = localDummy(cls, impl)
+ val body1 = typedStats(body, dummy)(inClassContext(self1.symbol))
checkNoDoubleDefs(cls)
val impl1 = cpy.Template(impl, constr1, parents1, self1, body1)
- .withType(localDummy.termRef)
+ .withType(dummy.termRef)
assignType(cpy.TypeDef(cdef, mods1, name, impl1), cls)
// todo later: check that
@@ -825,6 +825,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
// 4. Polymorphic type defs override nothing.
}
+ def localDummy(cls: ClassSymbol, impl: untpd.Template)(implicit ctx: Context): Symbol =
+ ctx.newLocalDummy(cls, impl.pos)
+
def typedImport(imp: untpd.Import, sym: Symbol)(implicit ctx: Context): Import = track("typedImport") {
val expr1 = typedExpr(imp.expr, AnySelectionProto)
checkStable(expr1.tpe, imp.expr.pos)