提交 5bb7c212 编写于 作者: A Alex Tkachman

KT-1538 proper boolean invertion

上级 e007ce8c
......@@ -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));
}
}
import java.util.HashMap
fun parseCatalogs(hashMap: Any?) {
val r = toHasMap(hashMap)
if (!r._1) {
return
}
val nodes = r._2
}
fun toHasMap(value: Any?): #(Boolean, HashMap<String, Any?>?) {
if(value is HashMap<*, *>) {
return #(true, value as HashMap<String, Any?>)
}
return #(false, null as HashMap<String, Any?>?)
}
fun box() : String {
parseCatalogs(null)
return "OK"
}
\ No newline at end of file
......@@ -307,4 +307,9 @@ public class ClassGenTest extends CodegenTestCase {
public void testKt1345() throws Exception {
blackBoxFile("regressions/kt1345.kt");
}
public void testKt1538() throws Exception {
blackBoxFile("regressions/kt1538.kt");
System.out.println(generateToText());
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册