Add synthetic flag to generated private suspend functions
Private suspend functions need to be generated as package-local, since they are called from their continuations. However, this means that they can be called from Java, which breaks their private visibility. Adding synthetic to them fixes the issue. #KT-17584: Fixed
This commit is contained in:
@@ -244,7 +244,8 @@ public class AsmUtil {
|
||||
int flags = getVisibilityAccessFlag(functionDescriptor);
|
||||
flags |= getVarargsFlag(functionDescriptor);
|
||||
flags |= getDeprecatedAccessFlag(functionDescriptor);
|
||||
if (state.getDeprecationProvider().isDeprecatedHidden(functionDescriptor)) {
|
||||
if (state.getDeprecationProvider().isDeprecatedHidden(functionDescriptor) ||
|
||||
(functionDescriptor.isSuspend()) && functionDescriptor.getVisibility().equals(Visibilities.PRIVATE)) {
|
||||
flags |= ACC_SYNTHETIC;
|
||||
}
|
||||
return flags;
|
||||
|
||||
Reference in New Issue
Block a user