[JS IR BE] Fix boolean and/or generation
This commit is contained in:
+5
@@ -6791,6 +6791,11 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/regression/typeChecks"), Pattern.compile("^([^_](.+))\\.kt$"), TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("booleanOperatorsTypes.kt")
|
||||
public void testBooleanOperatorsTypes() throws Exception {
|
||||
runTest("js/js.translator/testData/box/regression/typeChecks/booleanOperatorsTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("emptyVarargInConstructorCall.kt")
|
||||
public void testEmptyVarargInConstructorCall() throws Exception {
|
||||
runTest("js/js.translator/testData/box/regression/typeChecks/emptyVarargInConstructorCall.kt");
|
||||
|
||||
+5
@@ -6826,6 +6826,11 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/regression/typeChecks"), Pattern.compile("^([^_](.+))\\.kt$"), TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("booleanOperatorsTypes.kt")
|
||||
public void testBooleanOperatorsTypes() throws Exception {
|
||||
runTest("js/js.translator/testData/box/regression/typeChecks/booleanOperatorsTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("emptyVarargInConstructorCall.kt")
|
||||
public void testEmptyVarargInConstructorCall() throws Exception {
|
||||
runTest("js/js.translator/testData/box/regression/typeChecks/emptyVarargInConstructorCall.kt");
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// IGNORE_BACKEND: JS
|
||||
// EXPECTED_REACHABLE_NODES: 1281
|
||||
|
||||
package foo
|
||||
|
||||
fun check(x: Any?) {
|
||||
x as Boolean
|
||||
}
|
||||
|
||||
fun tests(x: Boolean, y: Boolean) {
|
||||
check(x)
|
||||
check(!x)
|
||||
check(x or y)
|
||||
check(x and y)
|
||||
check(x xor y)
|
||||
check(x.not())
|
||||
check(x || y)
|
||||
check(x && y)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
tests(false, false)
|
||||
tests(false, true)
|
||||
tests(true, false)
|
||||
tests(true, true)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user