KT-3517 Can't call .equals() on a boolean
#KT-3517 Fixed
This commit is contained in:
@@ -116,6 +116,7 @@ public class IntrinsicMethods {
|
|||||||
declareBinaryOp(Name.identifier("xor"), IXOR);
|
declareBinaryOp(Name.identifier("xor"), IXOR);
|
||||||
|
|
||||||
declareIntrinsicFunction(Name.identifier("Boolean"), Name.identifier("not"), 0, new Not());
|
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("String"), Name.identifier("plus"), 1, new Concat());
|
||||||
declareIntrinsicFunction(Name.identifier("CharSequence"), Name.identifier("get"), 1, new StringGetChar());
|
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");
|
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")
|
@TestMetadata("kt3576.kt")
|
||||||
public void testKt3576() throws Exception {
|
public void testKt3576() throws Exception {
|
||||||
doTest("compiler/testData/codegen/box/primitiveTypes/kt3576.kt");
|
doTest("compiler/testData/codegen/box/primitiveTypes/kt3576.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user