From 9d924441fdeab3bbe0c6cca8c1ecce6ecf64a608 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 9 Feb 2014 16:19:45 +0100 Subject: 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. --- src/dotty/tools/dotc/core/Definitions.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/core/Definitions.scala') diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala index b5ec98343..8c6e8d72c 100644 --- a/src/dotty/tools/dotc/core/Definitions.scala +++ b/src/dotty/tools/dotc/core/Definitions.scala @@ -37,8 +37,8 @@ class Definitions(implicit ctx: Context) { newTypeParam(cls, suffix.toTypeName.expandedName(cls), ExpandedName, scope) private def specialPolyClass(name: TypeName, paramFlags: FlagSet, parentConstrs: Type*): ClassSymbol = { - val completer = new LazyType { - def complete(denot: SymDenotation): Unit = { + val completer = new LazyType with CompleteInCreationContext { + def completeInCreationContext(denot: SymDenotation): Unit = { val cls = denot.asClass.classSymbol val paramDecls = newScope val typeParam = newSyntheticTypeParam(cls, paramDecls, paramFlags) @@ -368,8 +368,8 @@ class Definitions(implicit ctx: Context) { case 1 => EmptyFlags } - val completer = new LazyType { - def complete(denot: SymDenotation): Unit = { + val completer = new LazyType with CompleteInCreationContext { + def completeInCreationContext(denot: SymDenotation): Unit = { val cls = denot.asClass.classSymbol val paramDecls = newScope for ((v, i) <- vcs.zipWithIndex) -- cgit v1.2.3