JVM IR: generate private @JvmStatic functions as in old backend

#KT-46181 Fixed
This commit is contained in:
Alexander Udalov
2021-09-02 22:43:52 +02:00
parent ed035d99ab
commit 9a472c418f
13 changed files with 184 additions and 39 deletions
@@ -118,9 +118,7 @@ private class CompanionObjectJvmStaticTransformer(val context: JvmBackendContext
private fun IrSimpleFunction.needsStaticProxy(): Boolean = when {
// Case 1: `external` static methods are moved to the outer class. JNI code does not care about visibility.
isExternal -> true
// Case 2: `JvmStatic` is useless on private/inline-only methods because they're not visible to any Java code anyway.
visibility == DescriptorVisibilities.PRIVATE -> false
visibility == DescriptorVisibilities.PRIVATE_TO_THIS -> false
// Case 2: `JvmStatic` is useless on inline-only methods because they're not visible to any Java code anyway.
origin == JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_OR_TYPEALIAS_ANNOTATIONS -> false
isEffectivelyInlineOnly() -> false
// Case 3: protected non-inline needs a static proxy in the parent to be callable from subclasses