summaryrefslogtreecommitdiff
path: root/test/files/run/t6028.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-07-07 13:18:44 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-07-14 17:46:45 +0200
commit32dc7e80698c83947bf4b74f6eadd385a06f5b09 (patch)
treef0e574be3522e2513d00fa5c67c886460e18d338 /test/files/run/t6028.scala
parent39dfdb7cca23d109d07edc5884f8fb871cd0c582 (diff)
downloadscala-32dc7e80698c83947bf4b74f6eadd385a06f5b09.tar.gz
scala-32dc7e80698c83947bf4b74f6eadd385a06f5b09.tar.bz2
scala-32dc7e80698c83947bf4b74f6eadd385a06f5b09.zip
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
Diffstat (limited to 'test/files/run/t6028.scala')
-rw-r--r--test/files/run/t6028.scala22
1 files changed, 22 insertions, 0 deletions
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()
+ }
+ }
+}