Fix casts of Unit value to other types

This commit is contained in:
Alexander Udalov
2015-07-04 03:10:09 +03:00
parent 62c22bf0ec
commit cb03f0df5a
7 changed files with 52 additions and 15 deletions
@@ -3744,9 +3744,10 @@ The "returned" value of try expression with no finally is either the last expres
value.put(boxType(value.type), v);
if (value.type == Type.VOID_TYPE) {
v.aconst(null);
StackValue.putUnitInstance(v);
}
else if (opToken != JetTokens.AS_SAFE) {
if (opToken != JetTokens.AS_SAFE) {
if (!TypeUtils.isNullableType(rightType)) {
v.dup();
Label nonnull = new Label();