private void initializeProperty( @NotNull ExpressionCodegen codegen, @NotNull JetProperty property) { PropertyDescriptor propertyDescriptor = (PropertyDescriptor) bindingContext.get(VARIABLE, property); assert propertyDescriptor != null; JetExpression initializer = property.getDelegateExpressionOrInitializer(); assert initializer != null : "shouldInitializeProperty must return false if initializer is null"; JetType jetType = getPropertyOrDelegateType(property, propertyDescriptor); StackValue.Property propValue = codegen.intermediateValueForProperty( propertyDescriptor, true, null, MethodKind.INITIALIZER); if (!propValue.isStatic) { codegen.v.load(0, OBJECT_TYPE); } Type type = codegen.expressionType(initializer); if (jetType.isNullable()) { type = boxType(type); } codegen.gen(initializer, type); propValue.store(type, codegen.v); }
@Override public StackValue visitWhenExpression(JetWhenExpression expression, StackValue data) { return codegen.generateWhenExpression(expression, true); }
@Override public StackValue visitIfExpression(JetIfExpression expression, StackValue receiver) { return codegen.generateIfExpression(expression, true); }