aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-02-09 16:19:45 +0100
committerMartin Odersky <odersky@gmail.com>2014-02-09 16:24:30 +0100
commit9d924441fdeab3bbe0c6cca8c1ecce6ecf64a608 (patch)
tree7bfd0515195a83016bd03cbac0e54d49499e30aa /src/dotty/tools/dotc/typer/Namer.scala
parent6a6bc87871e1c6382da7023ab64c69391366c808 (diff)
downloaddotty-9d924441fdeab3bbe0c6cca8c1ecce6ecf64a608.tar.gz
dotty-9d924441fdeab3bbe0c6cca8c1ecce6ecf64a608.tar.bz2
dotty-9d924441fdeab3bbe0c6cca8c1ecce6ecf64a608.zip
Making completer take an implicit context
As a first step, we make the complete method in LazyType take an implicit context parameter. This requires a fairly large propagation of implicit contexts. The implicit parameter is ignored for classes inheriting from CompleteInCreationContext (which until now are all completers). The next step will be to make the complete methods of selective lazy types take the current context, rather than the creation context.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index e79bd32c1..4d184c17b 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -274,7 +274,7 @@ class Namer { typer: Typer =>
}
/** For all class definitions `stat` in `xstats`: If the companion class if not also defined
- * in `xstats`, invalidate it by setting its info to NoType.
+ * in `xstats`, invalidate it by setting its info to NoType.
*/
def invalidateCompanions(pkg: Symbol, xstats: List[untpd.Tree])(implicit ctx: Context): Unit = {
val definedNames = xstats collect { case stat: NameTree => stat.name }
@@ -350,7 +350,7 @@ class Namer { typer: Typer =>
}
/** The completer of a symbol defined by a member def or import (except ClassSymbols) */
- class Completer(val original: Tree)(implicit ctx: Context) extends LazyType {
+ class Completer(val original: Tree)(implicit ctx: Context) extends LazyType with CompleteInCreationContext {
protected def localContext(owner: Symbol) = ctx.fresh.withOwner(owner).withTree(original)
@@ -376,7 +376,7 @@ class Namer { typer: Typer =>
}
}
- def complete(denot: SymDenotation): Unit =
+ override def completeInCreationContext(denot: SymDenotation): Unit =
denot.info = typeSig(denot.symbol)
}
@@ -396,7 +396,7 @@ class Namer { typer: Typer =>
def init() = index(params)
/** The type signature of a ClassDef with given symbol */
- override def complete(denot: SymDenotation): Unit = {
+ override def completeInCreationContext(denot: SymDenotation): Unit = {
/** The type of a parent constructor. Types constructor arguments
* only if parent type contains uninstantiated type parameters.