diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2016-05-19 16:23:23 +1000 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-05-19 08:23:23 +0200 |
commit | 41c9a17e4f211fc24a931949a0819a0474cc004a (patch) | |
tree | 314788b6edb0286f3effb982204ba918a938d6c2 /src | |
parent | 07a8b197b93a6de54c890a7ee37254decc568880 (diff) | |
download | scala-41c9a17e4f211fc24a931949a0819a0474cc004a.tar.gz scala-41c9a17e4f211fc24a931949a0819a0474cc004a.tar.bz2 scala-41c9a17e4f211fc24a931949a0819a0474cc004a.zip |
Generate static forwarders for object members in companion interface (#5131)
We used to disable generation of static forwarders when a object had a
trait as a companion, as one could not add methods with bodies to an
interface in JVM 6.
The JVM lifted this restriction to support default methods in interfaces,
so we can lift the restriction on static forwarders, too.
Fixes https://github.com/scala/scala-dev/issues/59
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala index f190c1f2de..bddc41e5c6 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala @@ -164,8 +164,7 @@ abstract class BCodeSkelBuilder extends BCodeHelpers { } else { - val skipStaticForwarders = (claszSymbol.isInterface || settings.noForwarders) - if (!skipStaticForwarders) { + if (!settings.noForwarders) { val lmoc = claszSymbol.companionModule // add static forwarders if there are no name conflicts; see bugs #363 and #1735 if (lmoc != NoSymbol) { |