This commit is contained in:
Evgeny Gerashchenko
2013-06-11 20:04:27 +04:00
parent cfc99b941a
commit e8d0022406
3 changed files with 12 additions and 12 deletions
@@ -1629,7 +1629,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
expression.getReferencedNameElementType() == JetTokens.FIELD_IDENTIFIER && contextKind() != OwnerKind.TRAIT_IMPL; expression.getReferencedNameElementType() == JetTokens.FIELD_IDENTIFIER && contextKind() != OwnerKind.TRAIT_IMPL;
JetExpression r = getReceiverForSelector(expression); JetExpression r = getReceiverForSelector(expression);
boolean isSuper = r instanceof JetSuperExpression; boolean isSuper = r instanceof JetSuperExpression;
propertyDescriptor = accessablePropertyDescriptor(propertyDescriptor); propertyDescriptor = accessiblePropertyDescriptor(propertyDescriptor);
StackValue iValue = StackValue iValue =
intermediateValueForProperty(propertyDescriptor, directToField, isSuper ? (JetSuperExpression) r : null); intermediateValueForProperty(propertyDescriptor, directToField, isSuper ? (JetSuperExpression) r : null);
if (directToField) { if (directToField) {
@@ -1800,7 +1800,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
} }
} }
propertyDescriptor = accessablePropertyDescriptor(propertyDescriptor); propertyDescriptor = accessiblePropertyDescriptor(propertyDescriptor);
if (propertyDescriptor.getGetter() != null) { if (propertyDescriptor.getGetter() != null) {
callableGetter = typeMapper callableGetter = typeMapper
@@ -1865,7 +1865,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
throw new UnsupportedOperationException("unknown type of callee descriptor: " + funDescriptor); throw new UnsupportedOperationException("unknown type of callee descriptor: " + funDescriptor);
} }
funDescriptor = accessableFunctionDescriptor((FunctionDescriptor) funDescriptor); funDescriptor = accessibleFunctionDescriptor((FunctionDescriptor) funDescriptor);
if (funDescriptor instanceof ConstructorDescriptor) { if (funDescriptor instanceof ConstructorDescriptor) {
return generateNewCall(expression, resolvedCall, receiver); return generateNewCall(expression, resolvedCall, receiver);
@@ -1944,13 +1944,13 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
} }
@NotNull @NotNull
private PropertyDescriptor accessablePropertyDescriptor(PropertyDescriptor propertyDescriptor) { private PropertyDescriptor accessiblePropertyDescriptor(PropertyDescriptor propertyDescriptor) {
return context.accessablePropertyDescriptor(propertyDescriptor); return context.accessiblePropertyDescriptor(propertyDescriptor);
} }
@NotNull @NotNull
protected FunctionDescriptor accessableFunctionDescriptor(FunctionDescriptor fd) { protected FunctionDescriptor accessibleFunctionDescriptor(FunctionDescriptor fd) {
return context.accessableFunctionDescriptor(fd); return context.accessibleFunctionDescriptor(fd);
} }
@NotNull @NotNull
@@ -1972,7 +1972,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
} }
} }
fd = accessableFunctionDescriptor(fd); fd = accessibleFunctionDescriptor(fd);
Callable callable = resolveToCallable(fd, superCall); Callable callable = resolveToCallable(fd, superCall);
if (callable instanceof CallableMethod) { if (callable instanceof CallableMethod) {
@@ -996,7 +996,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
ConstructorDescriptor constructorDescriptor = DescriptorUtils.getConstructorOfSingletonObject(fieldTypeDescriptor); ConstructorDescriptor constructorDescriptor = DescriptorUtils.getConstructorOfSingletonObject(fieldTypeDescriptor);
ExpressionCodegen codegen = createOrGetClInitCodegen(); ExpressionCodegen codegen = createOrGetClInitCodegen();
FunctionDescriptor fd = codegen.accessableFunctionDescriptor(constructorDescriptor); FunctionDescriptor fd = codegen.accessibleFunctionDescriptor(constructorDescriptor);
generateMethodCallTo(fd, codegen.v); generateMethodCallTo(fd, codegen.v);
field.store(field.type, codegen.v); field.store(field.type, codegen.v);
} }
@@ -1112,7 +1112,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
//generate object$ //generate object$
parentCodegen.genInitSingleton(descriptor, StackValue.singleton(descriptor, typeMapper)); parentCodegen.genInitSingleton(descriptor, StackValue.singleton(descriptor, typeMapper));
parentCodegen.generateInitializers(parentCodegen.createOrGetClInitCodegen(), parentCodegen.generateInitializers(parentCodegen.createOrGetClInitCodegen(),
myClass.getDeclarations(), bindingContext, state); myClass.getDeclarations(), bindingContext, state);
} else { } else {
generateInitializers(codegen, myClass.getDeclarations(), bindingContext, state); generateInitializers(codegen, myClass.getDeclarations(), bindingContext, state);
} }
@@ -317,12 +317,12 @@ public abstract class CodegenContext<T extends DeclarationDescriptor> {
} }
@NotNull @NotNull
public PropertyDescriptor accessablePropertyDescriptor(PropertyDescriptor propertyDescriptor) { public PropertyDescriptor accessiblePropertyDescriptor(PropertyDescriptor propertyDescriptor) {
return (PropertyDescriptor) accessibleDescriptorIfNeeded(propertyDescriptor, true); return (PropertyDescriptor) accessibleDescriptorIfNeeded(propertyDescriptor, true);
} }
@NotNull @NotNull
public FunctionDescriptor accessableFunctionDescriptor(FunctionDescriptor fd) { public FunctionDescriptor accessibleFunctionDescriptor(FunctionDescriptor fd) {
return (FunctionDescriptor) accessibleDescriptorIfNeeded(fd, true); return (FunctionDescriptor) accessibleDescriptorIfNeeded(fd, true);
} }