From e265373660e4727be6fcc6104d7a722ca662b53b Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 17 Sep 2015 13:32:51 +1000 Subject: SI-9473 Cleaner references to statically owned symbols Ever wonder why `identity("")` typechecks to `scala.this.Predef.identity("")`? It turns out that `mkAttributedRef` was importing `q"$scalaPackageClass.this.Predef._"` for all these years, rather than `q"$scalaModule.Predef._"`. This commit makes `mkAttributedRef` special case static owners by referring the the corresponding module, instead. --- test/files/neg/t6323a.check | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/files/neg/t6323a.check') diff --git a/test/files/neg/t6323a.check b/test/files/neg/t6323a.check index 261a60ef3c..c4e92d93f0 100644 --- a/test/files/neg/t6323a.check +++ b/test/files/neg/t6323a.check @@ -1,10 +1,10 @@ -t6323a.scala:10: materializing requested scala.reflect.type.ClassTag[Test] using `package`.this.materializeClassTag[Test]() +t6323a.scala:10: materializing requested scala.reflect.type.ClassTag[Test] using scala.reflect.`package`.materializeClassTag[Test]() val lookAtMe = m.reflect(Test("a",List(5))) ^ -t6323a.scala:11: materializing requested reflect.runtime.universe.type.TypeTag[Test] using `package`.this.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) +t6323a.scala:11: materializing requested reflect.runtime.universe.type.TypeTag[Test] using scala.reflect.api.`package`.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) val value = u.typeOf[Test] ^ -t6323a.scala:11: `package`.this.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because: +t6323a.scala:11: scala.reflect.api.`package`.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because: failed to typecheck the materialized tag: cannot create a TypeTag referring to class Test.Test local to the reifee: use WeakTypeTag instead val value = u.typeOf[Test] -- cgit v1.2.3