ClassFormatError because of initializing variable with Any type with primitive value

#KT-3524 Fixed
This commit is contained in:
Natalia.Ukhorskaya
2013-05-08 17:17:39 +04:00
parent 551c370242
commit 9e584ded11
3 changed files with 13 additions and 3 deletions
@@ -122,9 +122,9 @@ public class PropertyCodegen extends GenerationStateAware {
private FieldVisitor generateBackingFieldAccess(PsiElement p, PropertyDescriptor propertyDescriptor) {
Object value = null;
JetExpression initializer = p instanceof JetProperty ? ((JetProperty) p).getInitializer() : null;
if (initializer != null) {
if (initializer instanceof JetConstantExpression && !propertyDescriptor.getType().isNullable()) {
if (p instanceof JetProperty && !ImplementationBodyCodegen.shouldInitializeProperty((JetProperty) p, typeMapper)) {
JetExpression initializer = ((JetProperty) p).getInitializer();
if (initializer != null) {
CompileTimeConstant<?> compileTimeValue = bindingContext.get(BindingContext.COMPILE_TIME_VALUE, initializer);
value = compileTimeValue != null ? compileTimeValue.getValue() : null;
}