Fix for KT-6383: Can't access a private static member of class object

#KT-6383 Fixed
This commit is contained in:
Michael Bogdanov
2014-12-02 14:51:38 +03:00
parent fda7f63957
commit 328dedc415
3 changed files with 33 additions and 5 deletions
@@ -30,11 +30,10 @@ class PlatformStaticGenerator(
val state: GenerationState
) : Function2<ImplementationBodyCodegen, ClassBuilder, Unit> {
override fun invoke(p1: ImplementationBodyCodegen, p2: ClassBuilder) {
override fun invoke(codegen: ImplementationBodyCodegen, classBuilder: ClassBuilder) {
val typeMapper = state.getTypeMapper()
val callable = typeMapper.mapToCallableMethod(descriptor, false, p1.getContext())
val asmMethod = callable.getAsmMethod()
val methodVisitor = p2.newMethod(
val asmMethod = typeMapper.mapSignature(descriptor).getAsmMethod()
val methodVisitor = classBuilder.newMethod(
Synthetic(declarationOrigin.element, descriptor),
Opcodes.ACC_STATIC or AsmUtil.getMethodAsmFlags(descriptor, OwnerKind.IMPLEMENTATION),
asmMethod.getName()!!,
@@ -55,7 +54,13 @@ class PlatformStaticGenerator(
iv.load(index, paramType);
index += paramType.getSize();
}
callable.invokeWithoutAssertions(iv)
val syntheticOrOriginalMethod = typeMapper.mapToCallableMethod(
codegen.getContext().accessibleFunctionDescriptor(descriptor),
false,
codegen.getContext()
)
syntheticOrOriginalMethod.invokeWithoutAssertions(iv)
iv.areturn(asmMethod.getReturnType());
methodVisitor.visitEnd();
}