summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-07-06 20:13:42 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2015-07-23 15:02:18 +0200
commitef9d84567655d6f8c9b8541aef4beb706f2a13ec (patch)
treea0f503f70207199dbfadbc7ba2d5d08c8deb8b17 /test/files/run
parent60747c75555fdcfefc9d10460050be5e2a11ad85 (diff)
downloadscala-ef9d84567655d6f8c9b8541aef4beb706f2a13ec.tar.gz
scala-ef9d84567655d6f8c9b8541aef4beb706f2a13ec.tar.bz2
scala-ef9d84567655d6f8c9b8541aef4beb706f2a13ec.zip
[backport] 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
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/scalapInvokedynamic.check5
-rw-r--r--test/files/run/scalapInvokedynamic.scala11
2 files changed, 16 insertions, 0 deletions
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