Fix for KT-13890: IllegalAccessError when invoking protected method with default arguments

#KT-13890 Fixed
This commit is contained in:
Michael Bogdanov
2016-10-25 12:15:21 +03:00
parent 1e59161e8f
commit eaf9c2e8b0
4 changed files with 39 additions and 5 deletions
@@ -845,14 +845,13 @@ public class FunctionCodegen {
return;
}
int flags = getVisibilityAccessFlag(functionDescriptor) |
getDeprecatedAccessFlag(functionDescriptor) |
ACC_SYNTHETIC;
// $default methods are never private to be accessible from other class files (e.g. inner) without the need of synthetic accessors
// $default methods are never protected to be accessible from subclass nested classes
int visibilityFlag = Visibilities.isPrivate(functionDescriptor.getVisibility()) ? AsmUtil.NO_FLAG_PACKAGE_PRIVATE : Opcodes.ACC_PUBLIC;
int flags = visibilityFlag | getDeprecatedAccessFlag(functionDescriptor) | ACC_SYNTHETIC;
if (!(functionDescriptor instanceof ConstructorDescriptor)) {
flags |= ACC_STATIC | ACC_BRIDGE;
}
// $default methods are never private to be accessible from other class files (e.g. inner) without the need of synthetic accessors
flags &= ~ACC_PRIVATE;
Method defaultMethod = typeMapper.mapDefaultMethod(functionDescriptor, kind);