diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-14 04:23:30 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-14 04:23:30 -0700 |
commit | 1c5526ed81a27550cc4f376d6debe89216470c51 (patch) | |
tree | f8ab619e3f5e1c54bb2af299b77f1437eca63705 /test/files/run | |
parent | 12baa2ea399b4f281c62fd20479c1e626f244d03 (diff) | |
parent | f783d0b16b41641b07ca76c03ad2f25a80ff8f2b (diff) | |
download | scala-1c5526ed81a27550cc4f376d6debe89216470c51.tar.gz scala-1c5526ed81a27550cc4f376d6debe89216470c51.tar.bz2 scala-1c5526ed81a27550cc4f376d6debe89216470c51.zip |
Merge pull request #1101 from scalamacros/ticket/5940
SI-5940 impls are no longer in macro def pickles
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t5940.scala | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/files/run/t5940.scala b/test/files/run/t5940.scala new file mode 100644 index 0000000000..147ff38256 --- /dev/null +++ b/test/files/run/t5940.scala @@ -0,0 +1,41 @@ +import scala.tools.partest._ + +object Test extends DirectTest { + def code = ??? + + def macros_1 = """ + import scala.reflect.macros.Context + + object Impls { + def impl(c: Context) = c.literalUnit + } + + object Macros { + //import Impls._ + def impl(c: Context) = c.literalUnit + def foo = macro impl + } + """ + def compileMacros() = { + val classpath = List(sys.props("partest.lib"), sys.props("partest.reflect")) mkString sys.props("path.separator") + compileString(newCompiler("-language:experimental.macros", "-cp", classpath, "-d", testOutput.path))(macros_1) + } + + def test_2 = """ + object Test extends App { + println(Macros.foo) + } + """ + def compileTest() = { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(test_2) + } + + def show(): Unit = { + log("Compiling Macros_1...") + if (compileMacros()) { + log("Compiling Test_2...") + if (compileTest()) log("Success!") else log("Failed...") + } + } +}
\ No newline at end of file |