diff options
author | aleksandar <aleksandar@lampmac14.epfl.ch> | 2012-01-12 15:38:55 +0100 |
---|---|---|
committer | aleksandar <aleksandar@lampmac14.epfl.ch> | 2012-01-12 15:38:55 +0100 |
commit | 91fcdf64d406aed26d473091c3328c0cf089e115 (patch) | |
tree | e3897d0cc6b680d32581a740b16a4ad5ef0839ef /test/pending/run/reify_closure1.scala | |
parent | 51ddeb372b3f0b22041d9a51f3faee17acd7b749 (diff) | |
parent | 5f5029d2ac6348ecb07fc11f6656621c662ced92 (diff) | |
download | scala-91fcdf64d406aed26d473091c3328c0cf089e115.tar.gz scala-91fcdf64d406aed26d473091c3328c0cf089e115.tar.bz2 scala-91fcdf64d406aed26d473091c3328c0cf089e115.zip |
Merge branch 'master' into issue/4147
Conflicts:
.gitignore
Diffstat (limited to 'test/pending/run/reify_closure1.scala')
-rw-r--r-- | test/pending/run/reify_closure1.scala | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/pending/run/reify_closure1.scala b/test/pending/run/reify_closure1.scala new file mode 100644 index 0000000000..825a38dc1d --- /dev/null +++ b/test/pending/run/reify_closure1.scala @@ -0,0 +1,20 @@ +import scala.tools.nsc.reporters._ +import scala.tools.nsc.Settings +import reflect.runtime.Mirror.ToolBox + +object Test extends App { + def foo[T](ys: List[T]): Int => Int = { + val fun: reflect.Code[Int => Int] = x => { + x + } + + val reporter = new ConsoleReporter(new Settings) + val toolbox = new ToolBox(reporter) + val ttree = toolbox.typeCheck(fun.tree) + val dyn = toolbox.runExpr(ttree) + dyn.asInstanceOf[Int => Int] + } + + println(foo(List(1, 2, 3))(10)) + println(foo(List(1, 2, 3, 4))(10)) +} |