summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2017-03-17 09:52:09 +0100
committerLukas Rytz <lukas.rytz@gmail.com>2017-03-17 10:11:39 +0100
commit954ea7e2e94b211a0769747a2e03f48609eddb4d (patch)
treefe921bf2bcee5ce3b893f809e668e9d5a3b5394c /test
parent6048c661f7312be9bbfdde1edac963336d956c0e (diff)
downloadscala-954ea7e2e94b211a0769747a2e03f48609eddb4d.tar.gz
scala-954ea7e2e94b211a0769747a2e03f48609eddb4d.tar.bz2
scala-954ea7e2e94b211a0769747a2e03f48609eddb4d.zip
SI-10231 Skip outer parameter when classfile parsing java param names
Nested java classes have a synthetic outer parameter, which the classfile parser skips for the constructor symbol. When assigning parameter names from the MethodParameters classfile attribute, we also need to skip the first name in this case.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t10231/A_1.java11
-rw-r--r--test/files/run/t10231/Test_2.scala5
2 files changed, 16 insertions, 0 deletions
diff --git a/test/files/run/t10231/A_1.java b/test/files/run/t10231/A_1.java
new file mode 100644
index 0000000000..5cc2ed3606
--- /dev/null
+++ b/test/files/run/t10231/A_1.java
@@ -0,0 +1,11 @@
+/*
+ * javac: -parameters
+ */
+public class A_1 {
+ public class Inner {
+ public int x;
+ public Inner(int i) {
+ x = i;
+ }
+ }
+}
diff --git a/test/files/run/t10231/Test_2.scala b/test/files/run/t10231/Test_2.scala
new file mode 100644
index 0000000000..8f8150cab1
--- /dev/null
+++ b/test/files/run/t10231/Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ val a = new A_1
+ val i = new a.Inner(i = 99)
+ assert(i.x == 99)
+}