From 32dc7e80698c83947bf4b74f6eadd385a06f5b09 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sat, 7 Jul 2012 13:18:44 +0200 Subject: A test case that scrutinises lambdalifter's output. No doubt there are plenty of additional variations that could be added to exercise more code paths. This is the unflattering "before" photo; the next commit will make over the name mangling and reveal the simple beauty of unmangled names. References SI-6028 --- test/files/run/t6028.scala | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/files/run/t6028.scala (limited to 'test/files/run/t6028.scala') diff --git a/test/files/run/t6028.scala b/test/files/run/t6028.scala new file mode 100644 index 0000000000..7611aee0fc --- /dev/null +++ b/test/files/run/t6028.scala @@ -0,0 +1,22 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends DirectTest { + + override def extraSettings: String = "-usejavacp -Xprint:lambdalift -d " + testOutput.path + + override def code = """class T(classParam: Int) { + | val field: Int = 0 + | def foo(methodParam: Int) = {val methodLocal = 0 ; () => classParam + field + methodParam + methodLocal } + | def bar(barParam: Int) = { trait MethodLocalTrait { print(barParam) }; object MethodLocalObject extends MethodLocalTrait; MethodLocalObject } + | def tryy(tryyParam: Int) = { var tryyLocal = 0; () => try { tryyLocal = tryyParam } finally () } + |} + |""".stripMargin.trim + + override def show(): Unit = { + // redirect err to out, for logging + Console.withErr(System.out) { + compile() + } + } +} -- cgit v1.2.3