diff --git a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index c3841b8057d7..7688a7ae902f 100644 --- a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -679,7 +679,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma isFinal && !toDenot(sym).isClassConstructor && !(sym.is(Flags.Mutable)) && !(sym.enclosingClass.is(Flags.Trait)) def getsJavaPrivateFlag: Boolean = - isPrivate //|| (sym.isPrimaryConstructor && sym.owner.isTopLevelModuleClass) + isPrivate || (sym.isPrimaryConstructor && sym.owner.isTopLevelModuleClass) def isFinal: Boolean = sym.is(Flags.Final) def isStaticMember: Boolean = (sym ne NoSymbol) && diff --git a/tests/run/i6834.scala b/tests/run/i6834.scala new file mode 100644 index 000000000000..b01de4b15b16 --- /dev/null +++ b/tests/run/i6834.scala @@ -0,0 +1,5 @@ +object Foo +object Test { + def main(args: Array[String]) = + assert(Foo.getClass.getConstructors.length == 0) +} \ No newline at end of file