From f5d1f35f872acb4cc2b7af8835c96ccbfa143642 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Mon, 6 Jul 2015 20:13:42 +0200 Subject: Support methodHandle / invokeDynamic constant pool entries in scalap Add support in scalap to parse new constant pool entries - MethodHandle - MethodType - InvokeDynamic Spec: https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html --- test/files/run/scalapInvokedynamic.check | 5 +++++ test/files/run/scalapInvokedynamic.scala | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/files/run/scalapInvokedynamic.check create mode 100644 test/files/run/scalapInvokedynamic.scala (limited to 'test/files/run') diff --git a/test/files/run/scalapInvokedynamic.check b/test/files/run/scalapInvokedynamic.check new file mode 100644 index 0000000000..8e4b08f234 --- /dev/null +++ b/test/files/run/scalapInvokedynamic.check @@ -0,0 +1,5 @@ +class C extends scala.AnyRef { + def this() = { /* compiled code */ } + def m: java.lang.String = { /* compiled code */ } +} + diff --git a/test/files/run/scalapInvokedynamic.scala b/test/files/run/scalapInvokedynamic.scala new file mode 100644 index 0000000000..670cf26662 --- /dev/null +++ b/test/files/run/scalapInvokedynamic.scala @@ -0,0 +1,11 @@ +class C { + def m = { + val f = (x: String) => x.trim + f(" H ae i ") + } +} + +object Test extends App { + val testClassesDir = System.getProperty("partest.output") + scala.tools.scalap.Main.main(Array("-cp", testClassesDir, "C")) +} \ No newline at end of file -- cgit v1.2.3