summaryrefslogtreecommitdiff
path: root/test/files/run/sd242.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2016-10-09 10:24:00 -0500
committerLukas Rytz <lukas.rytz@gmail.com>2016-10-09 18:11:47 -0500
commite794e513264373bc73b0b338cb1fef647984e26a (patch)
tree3d0be200246e461c41a45fb03ad28299a9026cce /test/files/run/sd242.scala
parentada6b6b67a0ee3fd4e8251d22abce1cdd6cbb931 (diff)
downloadscala-e794e513264373bc73b0b338cb1fef647984e26a.tar.gz
scala-e794e513264373bc73b0b338cb1fef647984e26a.tar.bz2
scala-e794e513264373bc73b0b338cb1fef647984e26a.zip
Fix the interface flag when re-writing a closure call to the body method
When re-writing a closure invocation to the body method, the `itf` flag of the invocation instruction was incorrect: it needs to be true if the method is defined in an interface (including static methdos), not if the method is invoked through `INVOKEINTERFACE`. JDK 8 doesn't flag this inconsistency and executes the bytecode, but the verifier in JDK 9 throws an `IncompatibleClassChangeError`. Similar fixes went into e619b03.
Diffstat (limited to 'test/files/run/sd242.scala')
-rw-r--r--test/files/run/sd242.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/run/sd242.scala b/test/files/run/sd242.scala
new file mode 100644
index 0000000000..acd51ec893
--- /dev/null
+++ b/test/files/run/sd242.scala
@@ -0,0 +1,13 @@
+trait T {
+ def test: Unit = {
+ byName("".toString)
+ ()
+ }
+
+ @inline
+ final def byName(action: => Unit) = action
+}
+
+object Test extends App {
+ (new T {}).test
+}