KT-3517 Can't call .equals() on a boolean

#KT-3517 Fixed
This commit is contained in:
Natalia Ukhorskaya
2013-11-18 19:24:50 +04:00
parent 8dfe771f8e
commit d241bfc138
3 changed files with 12 additions and 0 deletions
@@ -116,6 +116,7 @@ public class IntrinsicMethods {
declareBinaryOp(Name.identifier("xor"), IXOR);
declareIntrinsicFunction(Name.identifier("Boolean"), Name.identifier("not"), 0, new Not());
declareIntrinsicFunction(Name.identifier("Boolean"), Name.identifier("equals"), 1, EQUALS);
declareIntrinsicFunction(Name.identifier("String"), Name.identifier("plus"), 1, new Concat());
declareIntrinsicFunction(Name.identifier("CharSequence"), Name.identifier("get"), 1, new StringGetChar());
@@ -0,0 +1,6 @@
// KT-3517 Can't call .equals() on a boolean
fun box(): String {
val a = false
return if (true.equals(true) && a.equals(false)) "OK" else "fail"
}
@@ -3732,6 +3732,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest("compiler/testData/codegen/box/primitiveTypes/kt3078.kt");
}
@TestMetadata("kt3517.kt")
public void testKt3517() throws Exception {
doTest("compiler/testData/codegen/box/primitiveTypes/kt3517.kt");
}
@TestMetadata("kt3576.kt")
public void testKt3576() throws Exception {
doTest("compiler/testData/codegen/box/primitiveTypes/kt3576.kt");