From eb4a2e3343c9ee0ceaa249fc36b257dd6c13edf3 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Thu, 6 Mar 2014 13:41:02 +0100 Subject: SI-8364 fixes cxTree lookup for imports This is reminiscent of the bug that I recently fixed in paradise: https://github.com/scalamacros/paradise/commit/0dc4e35883d357b7cbcdfd83b5b4821c1dcc0bb1. When doing something non-standard with contexts, we usually have to keep in mind that new contexts are created not only for trees that demarcate blocks of code, but also for imports. --- test/files/pos/t8364.check | 0 test/files/pos/t8364.scala | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100644 test/files/pos/t8364.check create mode 100644 test/files/pos/t8364.scala (limited to 'test') diff --git a/test/files/pos/t8364.check b/test/files/pos/t8364.check new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/files/pos/t8364.scala b/test/files/pos/t8364.scala new file mode 100644 index 0000000000..7a7ea1ff12 --- /dev/null +++ b/test/files/pos/t8364.scala @@ -0,0 +1,12 @@ +import scala.language.dynamics + +object MyDynamic extends Dynamic { + def selectDynamic(name: String): Any = ??? +} + +object Test extends App { + locally { + import java.lang.String + MyDynamic.id + } +} -- cgit v1.2.3