From ce55c3b08da29acafaa3c43796ead9cf854f1d34 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 11 Feb 2014 15:16:17 +0100 Subject: COnverted symOfTree and expandedTree to attachments. --- src/dotty/tools/dotc/typer/Typer.scala | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Typer.scala') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index e68109c9b..8c066cdd0 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -967,9 +967,13 @@ class Typer extends Namer with Applications with Implicits { xtree.removeAttachment(TypedAhead) match { case Some(ttree) => ttree case none => - val sym = symOfTree.getOrElse(xtree, NoSymbol) - sym.ensureCompleted() - symOfTree.remove(xtree) + val sym = xtree.removeAttachment(SymOfTree) match { + case Some(sym) => + sym.ensureCompleted() + sym + case none => + NoSymbol + } def localContext = { val freshCtx = ctx.fresh.withTree(xtree) if (sym.exists) freshCtx.withOwner(sym) @@ -1059,7 +1063,7 @@ class Typer extends Namer with Applications with Implicits { buf += imp1 traverse(rest)(importContext(imp1.symbol, imp.selectors)) case (mdef: untpd.DefTree) :: rest => - expandedTree remove mdef match { + mdef.removeAttachment(ExpandedTree) match { case Some(xtree) => traverse(xtree :: rest) case none => -- cgit v1.2.3