aboutsummaryrefslogtreecommitdiff
path: root/tests/run
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2017-04-11 18:59:48 +0200
committerGuillaume Martres <smarter@ubuntu.com>2017-04-11 19:26:35 +0200
commitd313143b4b4de1e6ac0a81582fc6164609a5eae1 (patch)
tree246835762d42dedd9d21764c3093b6eecbf14129 /tests/run
parent5a1bc13634ceea8fe1f120919293083045479cf9 (diff)
downloaddotty-d313143b4b4de1e6ac0a81582fc6164609a5eae1.tar.gz
dotty-d313143b4b4de1e6ac0a81582fc6164609a5eae1.tar.bz2
dotty-d313143b4b4de1e6ac0a81582fc6164609a5eae1.zip
SI-7455 Drop dummy param for synthetic access constructor
Adapted from scalac commit 050b4c951c838699c2fe30cbf01b63942c63a299 by Jason Zaugg: Java synthesizes public constructors in private classes to allow access from inner classes. The signature of that synthetic constructor (known as a "access constructor") has a dummy parameter appended to avoid overloading clashes. javac chooses the type "Enclosing$1" for the dummy parameter (called the "access constructor tag") which is either an existing anonymous class or a synthesized class for this purpose. In OpenJDK, this transformation is performed in: langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java (Incidentally, scalac would just emits a byte-code public constructor in this situation, rather than a private constructor / access constructor pair.) Scala parses the signature of the access contructor, and drops the $outer parameter, but retains the dummy parameter. This causes havoc when it tries to parse the bytecode for that anonymous class; the class file parser doesn't have the enclosing type parameters of Vector in scope and crash ensues. In any case, we shouldn't allow user code to see that constructor; it should only be called from within its own compilation unit. This commit drops the dummy parameter from access constructor signatures in class file parsing.
Diffstat (limited to 'tests/run')
0 files changed, 0 insertions, 0 deletions