summaryrefslogtreecommitdiff
path: root/test/files/run/toolbox_typecheck_macrosdisabled.scala
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2012-09-12 10:46:45 -0400
committerJosh Suereth <joshua.suereth@gmail.com>2012-09-13 13:04:23 -0400
commit7861ed6886ecf827907a6b48f0628395f199f49b (patch)
treefeae260b291c0fe1a819dd3109ac3f841ca90a39 /test/files/run/toolbox_typecheck_macrosdisabled.scala
parent76d4e9a8071f9e102106696664376b7f70622582 (diff)
downloadscala-7861ed6886ecf827907a6b48f0628395f199f49b.tar.gz
scala-7861ed6886ecf827907a6b48f0628395f199f49b.tar.bz2
scala-7861ed6886ecf827907a6b48f0628395f199f49b.zip
Fixes SI-6259. Unable to use typeOf in super call of top-level object.
This works around the issue of the inability to use classOf for top-level object classes by inventing a new anonymous class and instantiating it just to grab its class. Since the class is a nested type of the top-level object it'll be in the same classloader unless some kind of evil behavior is afoot. This patch should be undone if ever SI-2453 ever gets fixed, or we wind up with a direct way to grab the class of an object.
Diffstat (limited to 'test/files/run/toolbox_typecheck_macrosdisabled.scala')
-rw-r--r--test/files/run/toolbox_typecheck_macrosdisabled.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/files/run/toolbox_typecheck_macrosdisabled.scala b/test/files/run/toolbox_typecheck_macrosdisabled.scala
index bcbd637e02..01a418d42e 100644
--- a/test/files/run/toolbox_typecheck_macrosdisabled.scala
+++ b/test/files/run/toolbox_typecheck_macrosdisabled.scala
@@ -3,6 +3,10 @@ import scala.reflect.runtime.{universe => ru}
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
+// Note: If you're looking at this test and you don't know why, you may
+// have accidentally changed the way type tags reify. If so, validate
+// that your changes are accurate and update the check file.
+
object Test extends App {
val toolbox = cm.mkToolBox()
val rupkg = cm.staticModule("scala.reflect.runtime.package")
@@ -17,4 +21,4 @@ object Test extends App {
val tree2 = Apply(Select(Ident(ru), newTermName("reify")), List(Literal(Constant(2))))
val ttree2 = toolbox.typeCheck(tree2, withMacrosDisabled = true)
println(ttree2)
-} \ No newline at end of file
+}