diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-10-09 08:54:10 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-10-09 08:54:10 -0700 |
commit | 7ca76c8b3bef2d46333b4571806b126533239cda (patch) | |
tree | b8e1505229add5ec116ca7ff682078c8e5c64c37 /test | |
parent | 859ec02495993f225647df50397b042a3172351b (diff) | |
parent | 49dcb8ff33483949cecce671a2d87676cefa457f (diff) | |
download | scala-7ca76c8b3bef2d46333b4571806b126533239cda.tar.gz scala-7ca76c8b3bef2d46333b4571806b126533239cda.tar.bz2 scala-7ca76c8b3bef2d46333b4571806b126533239cda.zip |
Merge pull request #1458 from scalamacros/pullrequest/reflection
Another reflection bomb
Diffstat (limited to 'test')
4 files changed, 16 insertions, 4 deletions
diff --git a/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala b/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala index 089f30f389..adecfcff17 100644 --- a/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala +++ b/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala @@ -11,7 +11,7 @@ object Test extends App { val macrobody = Select(Ident(newTermName("Impls")), newTermName("foo")) val macroparam = ValDef(NoMods, newTermName("x"), TypeTree(definitions.IntClass.toType), EmptyTree) val macrodef = DefDef(Modifiers(MACRO), newTermName("foo"), Nil, List(List(macroparam)), TypeTree(), macrobody) - val modulector = DefDef(NoMods, nme.CONSTRUCTOR, Nil, List(List()), TypeTree(), Block(Apply(Select(Super(This(EmptyTypeName), EmptyTypeName), nme.CONSTRUCTOR), List()))) + val modulector = DefDef(NoMods, nme.CONSTRUCTOR, Nil, List(List()), TypeTree(), Block(Apply(Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR), List()))) val module = ModuleDef(NoMods, newTermName("Macros"), Template(Nil, emptyValDef, List(modulector, macrodef))) val macroapp = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42)))) val tree = Block(macrodef, module, macroapp) diff --git a/test/files/run/macro-typecheck-implicitsdisabled.check b/test/files/run/macro-typecheck-implicitsdisabled.check index 6cf25076a7..c4fa2c5c28 100644 --- a/test/files/run/macro-typecheck-implicitsdisabled.check +++ b/test/files/run/macro-typecheck-implicitsdisabled.check @@ -1,2 +1,2 @@ scala.this.Predef.any2ArrowAssoc[Int](1).->[Int](2) -scala.reflect.internal.Types$TypeError: value -> is not a member of Int +scala.reflect.macros.TypecheckException: value -> is not a member of Int diff --git a/test/files/run/reflection-magicsymbols-invoke.scala b/test/files/run/reflection-magicsymbols-invoke.scala index b38d1be7b2..5f39370708 100644 --- a/test/files/run/reflection-magicsymbols-invoke.scala +++ b/test/files/run/reflection-magicsymbols-invoke.scala @@ -2,6 +2,12 @@ import scala.reflect.runtime.universe._ import scala.reflect.runtime.universe.definitions._ import scala.reflect.runtime.{currentMirror => cm} +package scala { + object ExceptionUtils { + def unwrapThrowable(ex: Throwable): Throwable = scala.reflect.runtime.ReflectionUtils.unwrapThrowable(ex) + } +} + object Test extends App { def key(sym: Symbol) = sym + ": " + sym.typeSignature def test(tpe: Type, receiver: Any, method: String, args: Any*) { @@ -13,7 +19,7 @@ object Test extends App { println(result) } catch { case ex: Throwable => - val realex = scala.reflect.runtime.ReflectionUtils.unwrapThrowable(ex) + val realex = scala.ExceptionUtils.unwrapThrowable(ex) println(realex.getClass + ": " + realex.getMessage) } print(s"testing ${tpe.typeSymbol.name}.$method: ") diff --git a/test/files/run/reflection-valueclasses-magic.scala b/test/files/run/reflection-valueclasses-magic.scala index a40b570774..c4a26e460a 100644 --- a/test/files/run/reflection-valueclasses-magic.scala +++ b/test/files/run/reflection-valueclasses-magic.scala @@ -3,6 +3,12 @@ import scala.reflect.runtime.universe.definitions._ import scala.reflect.runtime.{currentMirror => cm} import scala.reflect.ClassTag +package scala { + object ExceptionUtils { + def unwrapThrowable(ex: Throwable): Throwable = scala.reflect.runtime.ReflectionUtils.unwrapThrowable(ex) + } +} + object Test extends App { def key(sym: Symbol) = { sym match { @@ -35,7 +41,7 @@ object Test extends App { println(s"[${result.getClass}] =======> $result") } catch { case ex: Throwable => - val realex = scala.reflect.runtime.ReflectionUtils.unwrapThrowable(ex) + val realex = scala.ExceptionUtils.unwrapThrowable(ex) println(realex.getClass + ": " + realex.getMessage) } val meth = tpe.declaration(newTermName(method).encodedName.toTermName) |