aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-07-23 19:04:25 +0200
committerMartin Odersky <odersky@gmail.com>2014-08-03 18:07:20 +0200
commit24bc239cfecca609a62d30a40ceae745fa8318cf (patch)
tree97c694fcbc93fa0ebe04fcbd219c7aab998894cd /src/dotty/tools/dotc/typer/Typer.scala
parent4231d7a81fc9b49ceacac5a317817ee9feda79ae (diff)
downloaddotty-24bc239cfecca609a62d30a40ceae745fa8318cf.tar.gz
dotty-24bc239cfecca609a62d30a40ceae745fa8318cf.tar.bz2
dotty-24bc239cfecca609a62d30a40ceae745fa8318cf.zip
Added elimLocals miniphase
This phase drops the Local flag from all private[this] and protected[this] members. This allows subsequent code motions where code is moved from a class to its companion object. It invalidates variance checking, which is consequently disabled when retyping.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 0ce02d198..d5153bf13 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -844,7 +844,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
checkNoDoubleDefs(cls)
val impl1 = cpy.Template(impl, constr1, parents1, self1, body1)
.withType(dummy.termRef)
- VarianceChecker.check(impl1)
+ checkVariance(impl1)
assignType(cpy.TypeDef(cdef, mods1, name, impl1), cls)
// todo later: check that
@@ -856,6 +856,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
// 4. Polymorphic type defs override nothing.
}
+ /** Overridden in retyper */
+ def checkVariance(tree: Tree)(implicit ctx: Context) = VarianceChecker.check(tree)
+
def localDummy(cls: ClassSymbol, impl: untpd.Template)(implicit ctx: Context): Symbol =
ctx.newLocalDummy(cls, impl.pos)