Minor, reformat & fix warnings in intermediateValueForProperty
This commit is contained in:
@@ -2051,7 +2051,8 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
|||||||
isDefaultAccessor(propertyDescriptor.getGetter()) && isDefaultAccessor(propertyDescriptor.getSetter())))) {
|
isDefaultAccessor(propertyDescriptor.getGetter()) && isDefaultAccessor(propertyDescriptor.getSetter())))) {
|
||||||
fieldAccessorKind = JvmCodegenUtil.isDebuggerContext(context) ? AccessorKind.NORMAL : AccessorKind.IN_CLASS_COMPANION;
|
fieldAccessorKind = JvmCodegenUtil.isDebuggerContext(context) ? AccessorKind.NORMAL : AccessorKind.IN_CLASS_COMPANION;
|
||||||
}
|
}
|
||||||
else if ((syntheticBackingField &&
|
else //noinspection ConstantConditions
|
||||||
|
if ((syntheticBackingField &&
|
||||||
context.getFirstCrossInlineOrNonInlineContext().getParentContext().getContextDescriptor() != containingDeclaration)) {
|
context.getFirstCrossInlineOrNonInlineContext().getParentContext().getContextDescriptor() != containingDeclaration)) {
|
||||||
fieldAccessorKind = AccessorKind.FIELD_FROM_LOCAL;
|
fieldAccessorKind = AccessorKind.FIELD_FROM_LOCAL;
|
||||||
}
|
}
|
||||||
@@ -2077,17 +2078,16 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
|||||||
boolean skipPropertyAccessors;
|
boolean skipPropertyAccessors;
|
||||||
|
|
||||||
PropertyDescriptor originalPropertyDescriptor = DescriptorUtils.unwrapFakeOverride(propertyDescriptor);
|
PropertyDescriptor originalPropertyDescriptor = DescriptorUtils.unwrapFakeOverride(propertyDescriptor);
|
||||||
boolean directAccessToGetter = couldUseDirectAccessToProperty(propertyDescriptor, true, isDelegatedProperty, context,
|
boolean directAccessToGetter =
|
||||||
state.getShouldInlineConstVals());
|
couldUseDirectAccessToProperty(propertyDescriptor, true, isDelegatedProperty, context, state.getShouldInlineConstVals());
|
||||||
boolean directAccessToSetter = couldUseDirectAccessToProperty(propertyDescriptor, false, isDelegatedProperty, context,
|
boolean directAccessToSetter =
|
||||||
state.getShouldInlineConstVals());
|
couldUseDirectAccessToProperty(propertyDescriptor, false, isDelegatedProperty, context, state.getShouldInlineConstVals());
|
||||||
|
|
||||||
if (fieldAccessorKind == AccessorKind.LATEINIT_INTRINSIC) {
|
if (fieldAccessorKind == AccessorKind.LATEINIT_INTRINSIC) {
|
||||||
skipPropertyAccessors = !isPrivateProperty || context.getClassOrPackageParentContext() == backingFieldContext;
|
skipPropertyAccessors = !isPrivateProperty || context.getClassOrPackageParentContext() == backingFieldContext;
|
||||||
|
|
||||||
if (!skipPropertyAccessors) {
|
if (!skipPropertyAccessors) {
|
||||||
propertyDescriptor = (AccessorForPropertyBackingField)
|
propertyDescriptor = backingFieldContext.getAccessor(propertyDescriptor, fieldAccessorKind, delegateType, superCallTarget);
|
||||||
backingFieldContext.getAccessor(propertyDescriptor, fieldAccessorKind, delegateType, superCallTarget);
|
|
||||||
}
|
}
|
||||||
ownerDescriptor = propertyDescriptor;
|
ownerDescriptor = propertyDescriptor;
|
||||||
}
|
}
|
||||||
@@ -2097,10 +2097,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
|||||||
(directAccessToGetter && (!propertyDescriptor.isVar() || directAccessToSetter));
|
(directAccessToGetter && (!propertyDescriptor.isVar() || directAccessToSetter));
|
||||||
|
|
||||||
if (!skipPropertyAccessors) {
|
if (!skipPropertyAccessors) {
|
||||||
//noinspection ConstantConditions
|
propertyDescriptor = backingFieldContext.getAccessor(propertyDescriptor, fieldAccessorKind, delegateType, superCallTarget);
|
||||||
propertyDescriptor = (PropertyDescriptor) backingFieldContext.getAccessor(
|
|
||||||
propertyDescriptor, fieldAccessorKind, delegateType, superCallTarget
|
|
||||||
);
|
|
||||||
assert propertyDescriptor instanceof AccessorForPropertyBackingField :
|
assert propertyDescriptor instanceof AccessorForPropertyBackingField :
|
||||||
"Unexpected accessor descriptor: " + propertyDescriptor;
|
"Unexpected accessor descriptor: " + propertyDescriptor;
|
||||||
ownerDescriptor = propertyDescriptor;
|
ownerDescriptor = propertyDescriptor;
|
||||||
|
|||||||
Reference in New Issue
Block a user