diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala index 9ed88e7d1ad6..95ebf439fa6d 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala @@ -292,7 +292,7 @@ trait BCodeSkelBuilder extends BCodeHelpers { emitAnnotations(cnode, claszSymbol.annotations ++ ssa) if (!isCZStaticModule && !isCZParcelable) { - val skipStaticForwarders = (claszSymbol.isInterface || claszSymbol.is(Module) || ctx.settings.XnoForwarders.value) + val skipStaticForwarders = (claszSymbol.is(Module) || ctx.settings.XnoForwarders.value) if (!skipStaticForwarders) { val lmoc = claszSymbol.companionModule // add static forwarders if there are no name conflicts; see bugs #363 and #1735 diff --git a/compiler/test/dotc/run-test-pickling.blacklist b/compiler/test/dotc/run-test-pickling.blacklist index 873c34a19c42..ee24fb0df1cc 100644 --- a/compiler/test/dotc/run-test-pickling.blacklist +++ b/compiler/test/dotc/run-test-pickling.blacklist @@ -1,3 +1,6 @@ +## Many of these tests fail because CompilationTests.pickling does not handle +## tests containing java files correctly + derive-generic.scala eff-dependent.scala enum-java @@ -36,4 +39,5 @@ zero-arity-case-class.scala i12194.scala i12753 t6138 -t6138-2 \ No newline at end of file +t6138-2 +trait-static-forwarder diff --git a/tests/run/trait-static-forwarder.check b/tests/run/trait-static-forwarder.check new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tests/run/trait-static-forwarder.check @@ -0,0 +1 @@ +42 diff --git a/tests/run/trait-static-forwarder/Test.java b/tests/run/trait-static-forwarder/Test.java new file mode 100644 index 000000000000..89012c016209 --- /dev/null +++ b/tests/run/trait-static-forwarder/Test.java @@ -0,0 +1,5 @@ +public final class Test { + public static void main(String... args) { + System.out.println(T.foo()); + } +} diff --git a/tests/run/trait-static-forwarder/forwarders.scala b/tests/run/trait-static-forwarder/forwarders.scala new file mode 100644 index 000000000000..d6ee9a081d02 --- /dev/null +++ b/tests/run/trait-static-forwarder/forwarders.scala @@ -0,0 +1,5 @@ +trait T + +object T { + def foo = 42 +}