KT-1538 proper boolean invertion

This commit is contained in:
Alex Tkachman
2012-03-13 15:50:29 +02:00
parent e007ce8c62
commit 5bb7c2122d
4 changed files with 31 additions and 2 deletions
@@ -468,8 +468,10 @@ public abstract class StackValue {
private StackValue myOperand;
private Invert(StackValue operand) {
super(operand.type);
super(Type.BOOLEAN_TYPE);
myOperand = operand;
if(myOperand.type != Type.BOOLEAN_TYPE)
throw new UnsupportedOperationException("operand of ! must be boolean");
}
@Override
@@ -38,6 +38,7 @@ public class Not implements IntrinsicMethod {
else {
stackValue = receiver;
}
return StackValue.not(stackValue);
stackValue.put(Type.BOOLEAN_TYPE, v);
return StackValue.not(StackValue.onStack(Type.BOOLEAN_TYPE));
}
}