Fix for KT-6196: ClassCastException on unit property initializer

#KT-6196 Fixed
This commit is contained in:
Michael Bogdanov
2014-11-05 14:01:42 +03:00
parent 78bc15222b
commit ad6afee53f
3 changed files with 38 additions and 2 deletions
@@ -1209,8 +1209,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
return StackValue.none();
}
else {
Type type = expressionType(expression);
Type targetType = type.equals(UNIT_TYPE) ? type : OBJECT_TYPE;
Type targetType = expressionType(ifExpression);
gen(expression, targetType);