Fix for KT-10590: IllegalAccessError when protected getter of Java base class is accessed from lambda using property access syntax

This commit is contained in:
Michael Bogdanov
2016-01-25 13:02:42 +03:00
parent 9d66852ae2
commit cf09949354
6 changed files with 86 additions and 2 deletions
@@ -2213,9 +2213,11 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
StackValue receiver
) {
Type type = typeMapper.mapType(propertyDescriptor.getOriginal().getType());
CallableMethod callableGetter = typeMapper.mapToCallableMethod(propertyDescriptor.getGetMethod(), false);
CallableMethod callableGetter =
typeMapper.mapToCallableMethod(context.accessibleDescriptor(propertyDescriptor.getGetMethod(), null), false);
FunctionDescriptor setMethod = propertyDescriptor.getSetMethod();
CallableMethod callableSetter = setMethod != null ? typeMapper.mapToCallableMethod(setMethod, false) : null;
CallableMethod callableSetter =
setMethod != null ? typeMapper.mapToCallableMethod(context.accessibleDescriptor(setMethod, null), false) : null;
return StackValue.property(propertyDescriptor, null, type, false, null, callableGetter, callableSetter, state, receiver);
}