KT-877 - wrong codegen for unary plus

This commit is contained in:
Alex Tkachman
2012-01-02 09:49:04 +02:00
parent c3725054eb
commit cde54d59bd
3 changed files with 19 additions and 1 deletions
@@ -21,7 +21,12 @@ public class UnaryPlus implements IntrinsicMethod {
if(nullable) {
expectedType = JetTypeMapper.unboxType(expectedType);
}
receiver.put(expectedType, v);
if(receiver != null && receiver != StackValue.none())
receiver.put(expectedType, v);
else {
assert arguments != null;
codegen.gen(arguments.get(0), expectedType);
}
return StackValue.onStack(expectedType);
}
}