diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-02 06:10:59 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-02 06:10:59 -0700 |
commit | 937da62be2834a646a31dbfb01527a82672f111e (patch) | |
tree | 82b0b5efc904a6cf1355ee65631fa2e8c1a3c652 /test | |
parent | cc1e50531bf7957bf05fff21d87a04ac550ccb53 (diff) | |
parent | ddcba109843d4f665a010f3dbbd28a6b99e6185a (diff) | |
download | scala-937da62be2834a646a31dbfb01527a82672f111e.tar.gz scala-937da62be2834a646a31dbfb01527a82672f111e.tar.bz2 scala-937da62be2834a646a31dbfb01527a82672f111e.zip |
Merge pull request #1030 from scalamacros/ticket/5751
SI-5751 cleans up toolboxes for the release
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/reify_newimpl_45.scala | 3 | ||||
-rw-r--r-- | test/files/run/toolbox_typecheck_inferimplicitvalue.check | 1 | ||||
-rw-r--r-- | test/files/run/toolbox_typecheck_inferimplicitvalue.scala | 13 |
3 files changed, 16 insertions, 1 deletions
diff --git a/test/files/run/reify_newimpl_45.scala b/test/files/run/reify_newimpl_45.scala index d2254d6dde..cbae0839b2 100644 --- a/test/files/run/reify_newimpl_45.scala +++ b/test/files/run/reify_newimpl_45.scala @@ -8,7 +8,8 @@ object Test extends App { val code = reify{val x: T = "2".asInstanceOf[T]; println("ima worx: %s".format(x)); x} println(code.tree.freeTypes) val T = code.tree.freeTypes(0) - cm.mkToolBox().runExpr(code.tree, Map(T -> definitions.StringClass.asType)) + val tree = code.tree.substituteSymbols(List(T), List(definitions.StringClass)) + cm.mkToolBox().runExpr(tree) } new C[String] diff --git a/test/files/run/toolbox_typecheck_inferimplicitvalue.check b/test/files/run/toolbox_typecheck_inferimplicitvalue.check new file mode 100644 index 0000000000..23ba536aff --- /dev/null +++ b/test/files/run/toolbox_typecheck_inferimplicitvalue.check @@ -0,0 +1 @@ +C.MC
diff --git a/test/files/run/toolbox_typecheck_inferimplicitvalue.scala b/test/files/run/toolbox_typecheck_inferimplicitvalue.scala new file mode 100644 index 0000000000..3c5c994ac9 --- /dev/null +++ b/test/files/run/toolbox_typecheck_inferimplicitvalue.scala @@ -0,0 +1,13 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +class C +object C { + implicit object MC extends C +} + +object Test extends App { + val tb = cm.mkToolBox() + println(tb.inferImplicitValue(typeOf[C])) +}
\ No newline at end of file |