JVM IR: Do not generate private suspend functions as synthetic package-private
#KT-26592
This commit is contained in:
-1
@@ -165,7 +165,6 @@ class FunctionCodegen(
|
||||
}
|
||||
val isSynthetic = origin.isSynthetic ||
|
||||
hasAnnotation(JVM_SYNTHETIC_ANNOTATION_FQ_NAME) ||
|
||||
(isSuspend && DescriptorVisibilities.isPrivate(visibility) && !isInline) ||
|
||||
isReifiable() ||
|
||||
isDeprecatedHidden()
|
||||
|
||||
|
||||
@@ -208,10 +208,6 @@ private fun IrDeclarationWithVisibility.specialCaseVisibility(kind: OwnerKind?):
|
||||
return null
|
||||
}
|
||||
|
||||
if (this is IrSimpleFunction && isSuspend) {
|
||||
return AsmUtil.NO_FLAG_PACKAGE_PRIVATE
|
||||
}
|
||||
|
||||
if (this is IrConstructor && parentAsClass.kind === ClassKind.ENUM_ENTRY) {
|
||||
return AsmUtil.NO_FLAG_PACKAGE_PRIVATE
|
||||
}
|
||||
|
||||
-2
@@ -679,8 +679,6 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle
|
||||
val fromSubclassOfReceiversClass = !throughCrossinlineLambda &&
|
||||
context.isSubclassOf(ownerClass) && (thisObjReference == null || context.symbol.isSubtypeOfClass(thisObjReference))
|
||||
return when {
|
||||
// private suspend functions are generated as synthetic package private
|
||||
declaration is IrFunction && declaration.isSuspend && declaration.visibility.isPrivate && samePackage -> true
|
||||
declaration.visibility.isPrivate && (throughCrossinlineLambda || ownerClass != context) -> false
|
||||
declaration.visibility.isProtected && !samePackage && !fromSubclassOfReceiversClass -> false
|
||||
withSuper && !fromSubclassOfReceiversClass -> false
|
||||
|
||||
Reference in New Issue
Block a user