summaryrefslogtreecommitdiff
path: root/test/files/run/t6394b
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-19 12:05:19 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-19 17:14:42 +0200
commit50b5bdefec899bf441742a40f525234eac65cbaa (patch)
tree0fac51fe7d1a99cc12cdb718e30240b32e72bbbc /test/files/run/t6394b
parent3c542251e04cd85903ec12f5747c86d5c6c1a867 (diff)
downloadscala-50b5bdefec899bf441742a40f525234eac65cbaa.tar.gz
scala-50b5bdefec899bf441742a40f525234eac65cbaa.tar.bz2
scala-50b5bdefec899bf441742a40f525234eac65cbaa.zip
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.
Diffstat (limited to 'test/files/run/t6394b')
-rw-r--r--test/files/run/t6394b/Macros_1.scala12
-rw-r--r--test/files/run/t6394b/Test_2.scala4
2 files changed, 16 insertions, 0 deletions
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