From 648dae6a504f0a5c24d3a7f6efc996f508a006ce Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Wed, 19 Sep 2012 12:01:25 +0200 Subject: SI-6394 fixes macros.Context.enclosingClass Previously I used typer.context.enclClass, but it seems to do something completely unexpected, so I switched to manual context traversal. --- src/compiler/scala/reflect/macros/runtime/Enclosures.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/compiler/scala/reflect/macros/runtime/Enclosures.scala b/src/compiler/scala/reflect/macros/runtime/Enclosures.scala index ebde4447d7..b5c988ca83 100644 --- a/src/compiler/scala/reflect/macros/runtime/Enclosures.scala +++ b/src/compiler/scala/reflect/macros/runtime/Enclosures.scala @@ -14,7 +14,7 @@ trait Enclosures { // vals are eager to simplify debugging // after all we wouldn't save that much time by making them lazy val macroApplication: Tree = expandee - val enclosingClass: Tree = site.enclClass.tree + val enclosingClass: Tree = enclTrees collectFirst { case x: ImplDef => x } getOrElse EmptyTree val enclosingImplicits: List[(Type, Tree)] = site.openImplicits val enclosingMacros: List[Context] = this :: universe.analyzer.openMacros // include self val enclosingMethod: Tree = site.enclMethod.tree -- cgit v1.2.3