KT-36973 Keep private default interface members private
This commit is contained in:
+4
-5
@@ -233,11 +233,10 @@ class JvmDeclarationFactory(
|
||||
// Old backend doesn't generate ACC_FINAL on DefaultImpls methods.
|
||||
modality = Modality.OPEN,
|
||||
|
||||
// Interface functions are always public, with one exception: clone in Cloneable, which is protected. However, Cloneable
|
||||
// has no DefaultImpls, so this merely replicates the incorrect behavior of the old backend. We should rather not generate
|
||||
// a bridge to clone when interface inherits from Cloneable at all. Below, we force everything, including those bridges,
|
||||
// to be public so that we won't try to generate synthetic accessor for them.
|
||||
visibility = Visibilities.PUBLIC,
|
||||
// Interface functions are public or private, with one exception: clone in Cloneable, which is protected.
|
||||
// However, Cloneable has no DefaultImpls, so this merely replicates the incorrect behavior of the old backend.
|
||||
// We should rather not generate a bridge to clone when interface inherits from Cloneable at all.
|
||||
visibility = if (interfaceFun.visibility == Visibilities.PRIVATE) Visibilities.PRIVATE else Visibilities.PUBLIC,
|
||||
|
||||
typeParametersFromContext = parent.typeParameters
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user