From 50b5bdefec899bf441742a40f525234eac65cbaa Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Wed, 19 Sep 2012 12:05:19 +0200 Subject: fixes NameTypes in base names NameType is introduced in base.StandardNames#NamesBase to abstract away the difference between term names and type names in order to encode common names such as EMPTY or WILDCARD. Flavor-specific name repositories, such as TermNames and TypeNames are supposed to override NameType fixing it to correspondingly TermName or TypeName. Unfortunately I completely overlooked this and as a result some standard names were typed with insufficient precision, e.g. This(tpnme.EMPTY) didn't work. --- test/files/run/t6394b/Macros_1.scala | 12 ++++++++++++ test/files/run/t6394b/Test_2.scala | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 test/files/run/t6394b/Macros_1.scala create mode 100644 test/files/run/t6394b/Test_2.scala (limited to 'test/files/run/t6394b') diff --git a/test/files/run/t6394b/Macros_1.scala b/test/files/run/t6394b/Macros_1.scala new file mode 100644 index 0000000000..5d93e1cda8 --- /dev/null +++ b/test/files/run/t6394b/Macros_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.Context + +object Macros { + def impl(c:Context): c.Expr[Any] = { + import c.universe._ + + val selfTree = This(tpnme.EMPTY) + c.Expr[AnyRef](selfTree) + } + + def foo: Any = macro impl +} \ No newline at end of file diff --git a/test/files/run/t6394b/Test_2.scala b/test/files/run/t6394b/Test_2.scala new file mode 100644 index 0000000000..75e84f0e38 --- /dev/null +++ b/test/files/run/t6394b/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + println(Macros.foo) + override def toString = "TEST" +} \ No newline at end of file -- cgit v1.2.3