diff --git a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/outerCapturedInPrimaryConstructorDefaultParameter.kt b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/outerCapturedInPrimaryConstructorDefaultParameter.kt index 54a0d0f1f01..33d76ea670d 100644 --- a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/outerCapturedInPrimaryConstructorDefaultParameter.kt +++ b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/outerCapturedInPrimaryConstructorDefaultParameter.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6, WASM +// K2 issue: KT-64801 class Outer(val x: Any) { inner class Inner( @@ -6,4 +7,4 @@ class Outer(val x: Any) { ) } -fun box() = Outer("OK").Inner().fn() \ No newline at end of file +fun box() = Outer("OK").Inner().fn() diff --git a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/outerCapturedInSecondaryConstructorDefaultParameter.kt b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/outerCapturedInSecondaryConstructorDefaultParameter.kt index c0bc719c792..e2c0de2c53c 100644 --- a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/outerCapturedInSecondaryConstructorDefaultParameter.kt +++ b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/outerCapturedInSecondaryConstructorDefaultParameter.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6, WASM +// K2 issue: KT-64801 class Outer(val x: Any) { inner class Inner( @@ -11,4 +12,4 @@ class Outer(val x: Any) { } } -fun box() = Outer("OK").Inner(1).fn() \ No newline at end of file +fun box() = Outer("OK").Inner(1).fn() diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateToAnother/genericJavaProperty.kt b/compiler/testData/codegen/box/delegatedProperty/delegateToAnother/genericJavaProperty.kt index 3b68569c36e..680c44935e7 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateToAnother/genericJavaProperty.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateToAnother/genericJavaProperty.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 // WITH_REFLECT // WITH_STDLIB // FILE: J.java diff --git a/compiler/testData/codegen/box/extensionClasses/constructors.kt b/compiler/testData/codegen/box/extensionClasses/constructors.kt index 1daab3bc8ac..dbfd4f96d59 100644 --- a/compiler/testData/codegen/box/extensionClasses/constructors.kt +++ b/compiler/testData/codegen/box/extensionClasses/constructors.kt @@ -1,6 +1,5 @@ // !LANGUAGE: +ContextReceivers // TARGET_BACKEND: JVM_IR -// IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 // WITH_STDLIB class A(val ok: String) diff --git a/compiler/testData/codegen/box/innerNested/innerWithDefaultInner.kt b/compiler/testData/codegen/box/innerNested/innerWithDefaultInner.kt index 58c5e8cd6f9..6c4e7e514c8 100644 --- a/compiler/testData/codegen/box/innerNested/innerWithDefaultInner.kt +++ b/compiler/testData/codegen/box/innerNested/innerWithDefaultInner.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6, WASM - +// K2 issue: KT-64801 // KT-40686 @@ -22,4 +22,4 @@ fun box(): String { if (rr != "ABC") return "FAIL: $rr" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/multiplatform/expectClassInJvmMultifileFacade.kt b/compiler/testData/codegen/box/multiplatform/expectClassInJvmMultifileFacade.kt index cbb883878cb..a22a1b87e9e 100644 --- a/compiler/testData/codegen/box/multiplatform/expectClassInJvmMultifileFacade.kt +++ b/compiler/testData/codegen/box/multiplatform/expectClassInJvmMultifileFacade.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND_K2: JVM_IR, JS_IR // FIR status: expect/actual in the same module (ACTUAL_WITHOUT_EXPECT) // TARGET_BACKEND: JVM // IGNORE_BACKEND_K2: ANY diff --git a/compiler/testData/codegen/box/when/enumOptimization/kt14802.kt b/compiler/testData/codegen/box/when/enumOptimization/kt14802.kt index 4d34d166d30..28b3245563a 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/kt14802.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/kt14802.kt @@ -1,8 +1,5 @@ -// IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 // CHECK_CASES_COUNT: function=crash count=2 TARGET_BACKENDS=JS -// CHECK_CASES_COUNT: function=crash count=0 IGNORED_BACKENDS=JS // CHECK_IF_COUNT: function=crash count=1 TARGET_BACKENDS=JS -// CHECK_IF_COUNT: function=crash count=3 IGNORED_BACKENDS=JS class EncapsulatedEnum>(val value: T) @@ -28,4 +25,4 @@ var res = "fail" fun box(): String { crash(EncapsulatedEnum(MyEnum.VALUE_A)) return res -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/when/enumOptimization/kt15806.kt b/compiler/testData/codegen/box/when/enumOptimization/kt15806.kt index 71d00ee1d91..9c6a3e160b5 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/kt15806.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/kt15806.kt @@ -1,9 +1,6 @@ -// IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 // JVM_ABI_K1_K2_DIFF: KT-62903 // CHECK_CASES_COUNT: function=doTheThing count=2 TARGET_BACKENDS=JS -// CHECK_CASES_COUNT: function=doTheThing count=0 IGNORED_BACKENDS=JS // CHECK_IF_COUNT: function=doTheThing count=2 TARGET_BACKENDS=JS -// CHECK_IF_COUNT: function=doTheThing count=4 IGNORED_BACKENDS=JS private fun Any?.doTheThing(): String { when (this) { @@ -28,4 +25,4 @@ enum class Level { fun box(): String { return "O".doTheThing() + Level.K.doTheThing() -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxError/semantic/mismatchTypeParameters.kt b/compiler/testData/codegen/boxError/semantic/mismatchTypeParameters.kt index 1aac52e2da4..4f08353b41e 100644 --- a/compiler/testData/codegen/boxError/semantic/mismatchTypeParameters.kt +++ b/compiler/testData/codegen/boxError/semantic/mismatchTypeParameters.kt @@ -1,6 +1,7 @@ // IGNORE_ERRORS // ERROR_POLICY: SEMANTIC // IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 +// K2 issue: KT-55250 // MODULE: lib // FILE: t.kt @@ -20,4 +21,4 @@ fun foo() { fun box(): String { foo() return storage -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxError/semantic/typeMismatch.kt b/compiler/testData/codegen/boxError/semantic/typeMismatch.kt index 8a9618c755e..1d5b2c31d63 100644 --- a/compiler/testData/codegen/boxError/semantic/typeMismatch.kt +++ b/compiler/testData/codegen/boxError/semantic/typeMismatch.kt @@ -1,6 +1,7 @@ // IGNORE_ERRORS // ERROR_POLICY: SEMANTIC // IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 +// K2 issue: KT-64810 // MODULE: lib // FILE: t.kt @@ -23,4 +24,4 @@ fun box(): String { return "OK" } return "FAIL" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxError/semantic/unmatchedArguments.kt b/compiler/testData/codegen/boxError/semantic/unmatchedArguments.kt index 7de65693333..7ae2474e104 100644 --- a/compiler/testData/codegen/boxError/semantic/unmatchedArguments.kt +++ b/compiler/testData/codegen/boxError/semantic/unmatchedArguments.kt @@ -1,6 +1,7 @@ // IGNORE_ERRORS // ERROR_POLICY: SEMANTIC // IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 +// K2 issue: KT-64817 // MODULE: lib // FILE: t.kt @@ -32,4 +33,4 @@ fun box(): String { } } return "FAIL" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxError/syntax/incorectLexicalName.kt b/compiler/testData/codegen/boxError/syntax/incorectLexicalName.kt index b4370cf9793..b41e23a5ab7 100644 --- a/compiler/testData/codegen/boxError/syntax/incorectLexicalName.kt +++ b/compiler/testData/codegen/boxError/syntax/incorectLexicalName.kt @@ -1,6 +1,7 @@ // IGNORE_ERRORS // ERROR_POLICY: SYNTAX // IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 +// K2 issue: KT-64845 // MODULE: lib // FILE: t.kt @@ -39,4 +40,4 @@ fun box(): String { } } return "FAIL" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxError/syntax/missedArgument.kt b/compiler/testData/codegen/boxError/syntax/missedArgument.kt index f805ebe1389..4c46feb87c3 100644 --- a/compiler/testData/codegen/boxError/syntax/missedArgument.kt +++ b/compiler/testData/codegen/boxError/syntax/missedArgument.kt @@ -1,6 +1,7 @@ // IGNORE_ERRORS // ERROR_POLICY: SYNTAX // IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 +// K2 issue: KT-64820 // MODULE: lib // FILE: t.kt @@ -21,4 +22,4 @@ fun box(): String { return "OK" } return "FAIL" -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.fir.ir.txt b/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.fir.ir.txt new file mode 100644 index 00000000000..68417b0b7fd --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.fir.ir.txt @@ -0,0 +1,52 @@ +FILE fqName: fileName:/dynamicArrayIncrementDecrement.kt + FUN name:testArrayIncrementDecrement visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Unit + VALUE_PARAMETER name:d index:0 type:dynamic + BLOCK_BODY + VAR name:t1 type:dynamic [val] + BLOCK type=dynamic origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:dynamic [val] + GET_VAR 'd: dynamic declared in .testArrayIncrementDecrement' type=dynamic origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String [val] + CONST String type=kotlin.String value="prefixIncr" + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + DYN_OP operator=INVOKE type=dynamic + receiver: DYN_MEMBER memberName='set' type=dynamic + GET_VAR 'val tmp_0: dynamic declared in .testArrayIncrementDecrement' type=dynamic origin=null + 0: GET_VAR 'val tmp_1: kotlin.String declared in .testArrayIncrementDecrement' type=kotlin.String origin=null + 1: DYN_OP operator=PREFIX_INCREMENT type=dynamic + receiver: DYN_OP operator=ARRAY_ACCESS type=dynamic + receiver: GET_VAR 'val tmp_0: dynamic declared in .testArrayIncrementDecrement' type=dynamic origin=null + 0: GET_VAR 'val tmp_1: kotlin.String declared in .testArrayIncrementDecrement' type=kotlin.String origin=null + DYN_OP operator=INVOKE type=dynamic + receiver: DYN_MEMBER memberName='get' type=dynamic + GET_VAR 'val tmp_0: dynamic declared in .testArrayIncrementDecrement' type=dynamic origin=null + 0: GET_VAR 'val tmp_1: kotlin.String declared in .testArrayIncrementDecrement' type=kotlin.String origin=null + VAR name:t2 type:dynamic [val] + BLOCK type=dynamic origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:dynamic [val] + GET_VAR 'd: dynamic declared in .testArrayIncrementDecrement' type=dynamic origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.String [val] + CONST String type=kotlin.String value="prefixDecr" + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + DYN_OP operator=INVOKE type=dynamic + receiver: DYN_MEMBER memberName='set' type=dynamic + GET_VAR 'val tmp_2: dynamic declared in .testArrayIncrementDecrement' type=dynamic origin=null + 0: GET_VAR 'val tmp_3: kotlin.String declared in .testArrayIncrementDecrement' type=kotlin.String origin=null + 1: DYN_OP operator=PREFIX_DECREMENT type=dynamic + receiver: DYN_OP operator=ARRAY_ACCESS type=dynamic + receiver: GET_VAR 'val tmp_2: dynamic declared in .testArrayIncrementDecrement' type=dynamic origin=null + 0: GET_VAR 'val tmp_3: kotlin.String declared in .testArrayIncrementDecrement' type=kotlin.String origin=null + DYN_OP operator=INVOKE type=dynamic + receiver: DYN_MEMBER memberName='get' type=dynamic + GET_VAR 'val tmp_2: dynamic declared in .testArrayIncrementDecrement' type=dynamic origin=null + 0: GET_VAR 'val tmp_3: kotlin.String declared in .testArrayIncrementDecrement' type=kotlin.String origin=null + VAR name:t3 type:dynamic [val] + DYN_OP operator=POSTFIX_INCREMENT type=dynamic + receiver: DYN_OP operator=ARRAY_ACCESS type=dynamic + receiver: GET_VAR 'd: dynamic declared in .testArrayIncrementDecrement' type=dynamic origin=null + 0: CONST String type=kotlin.String value="postfixIncr" + VAR name:t4 type:dynamic [val] + DYN_OP operator=POSTFIX_DECREMENT type=dynamic + receiver: DYN_OP operator=ARRAY_ACCESS type=dynamic + receiver: GET_VAR 'd: dynamic declared in .testArrayIncrementDecrement' type=dynamic origin=null + 0: CONST String type=kotlin.String value="postfixDecr" diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.fir.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.fir.kt.txt new file mode 100644 index 00000000000..0bb070e81c4 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.fir.kt.txt @@ -0,0 +1,16 @@ +fun testArrayIncrementDecrement(d: dynamic) { + val t1: dynamic = { // BLOCK + val tmp_0: dynamic = d + val tmp_1: String = "prefixIncr" + tmp_0.set(tmp_1, ++tmp_0[tmp_1]) /*~> Unit */ + tmp_0.get(tmp_1) + } + val t2: dynamic = { // BLOCK + val tmp_2: dynamic = d + val tmp_3: String = "prefixDecr" + tmp_2.set(tmp_3, --tmp_2[tmp_3]) /*~> Unit */ + tmp_2.get(tmp_3) + } + val t3: dynamic = d["postfixIncr"]++ + val t4: dynamic = d["postfixDecr"]-- +} diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.kt b/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.kt index 028727bb4e1..e393a66ebd8 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.kt @@ -1,7 +1,4 @@ // TARGET_BACKEND: JS_IR -// FIR_IDENTICAL - -// IGNORE_BACKEND_K2: JS_IR fun testArrayIncrementDecrement(d: dynamic) { val t1 = ++d["prefixIncr"] diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.fir.ir.txt b/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.fir.ir.txt new file mode 100644 index 00000000000..98bc92b4314 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.fir.ir.txt @@ -0,0 +1,97 @@ +FILE fqName: fileName:/dynamicMemberIncrementDecrement.kt + FUN name:testMemberIncrementDecrement visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Unit + VALUE_PARAMETER name:d index:0 type:dynamic + BLOCK_BODY + VAR name:t1 type:dynamic [val] + DYN_OP operator=PREFIX_INCREMENT type=dynamic + receiver: GET_VAR 'd: dynamic declared in .testMemberIncrementDecrement' type=dynamic origin=null + VAR name:t2 type:dynamic [val] + DYN_OP operator=PREFIX_DECREMENT type=dynamic + receiver: GET_VAR 'd: dynamic declared in .testMemberIncrementDecrement' type=dynamic origin=null + VAR name:t3 type:dynamic [val] + DYN_OP operator=POSTFIX_INCREMENT type=dynamic + receiver: DYN_MEMBER memberName='postfixIncr' type=dynamic + GET_VAR 'd: dynamic declared in .testMemberIncrementDecrement' type=dynamic origin=null + VAR name:t4 type:dynamic [val] + DYN_OP operator=POSTFIX_DECREMENT type=dynamic + receiver: DYN_MEMBER memberName='postfixDecr' type=dynamic + GET_VAR 'd: dynamic declared in .testMemberIncrementDecrement' type=dynamic origin=null + FUN name:testSafeMemberIncrementDecrement visibility:public modality:FINAL <> (d:dynamic) returnType:kotlin.Unit + VALUE_PARAMETER name:d index:0 type:dynamic + BLOCK_BODY + VAR name:t1 type:dynamic [val] + BLOCK type=dynamic origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:dynamic [val] + GET_VAR 'd: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + WHEN type=dynamic origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_0: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: BLOCK type=dynamic origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:dynamic [val] + GET_VAR 'val tmp_0: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + DYN_OP operator=EQ type=kotlin.Unit + receiver: DYN_MEMBER memberName='prefixIncr' type=kotlin.Unit + GET_VAR 'val tmp_1: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + 0: DYN_OP operator=PREFIX_INCREMENT type=dynamic + receiver: DYN_MEMBER memberName='prefixIncr' type=dynamic + GET_VAR 'val tmp_1: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + DYN_MEMBER memberName='prefixIncr' type=dynamic + GET_VAR 'val tmp_1: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + VAR name:t2 type:dynamic [val] + BLOCK type=dynamic origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:dynamic [val] + GET_VAR 'd: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + WHEN type=dynamic origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_2: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: BLOCK type=dynamic origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:dynamic [val] + GET_VAR 'val tmp_2: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + DYN_OP operator=EQ type=kotlin.Unit + receiver: DYN_MEMBER memberName='prefixDecr' type=kotlin.Unit + GET_VAR 'val tmp_3: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + 0: DYN_OP operator=PREFIX_DECREMENT type=dynamic + receiver: DYN_MEMBER memberName='prefixDecr' type=dynamic + GET_VAR 'val tmp_3: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + DYN_MEMBER memberName='prefixDecr' type=dynamic + GET_VAR 'val tmp_3: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + VAR name:t3 type:dynamic [val] + BLOCK type=dynamic origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:dynamic [val] + GET_VAR 'd: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + WHEN type=dynamic origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_4: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: DYN_OP operator=POSTFIX_INCREMENT type=dynamic + receiver: DYN_MEMBER memberName='postfixIncr' type=dynamic + GET_VAR 'val tmp_4: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + VAR name:t4 type:dynamic [val] + BLOCK type=dynamic origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:dynamic [val] + GET_VAR 'd: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + WHEN type=dynamic origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_5: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: DYN_OP operator=POSTFIX_DECREMENT type=dynamic + receiver: DYN_MEMBER memberName='postfixDecr' type=dynamic + GET_VAR 'val tmp_5: dynamic declared in .testSafeMemberIncrementDecrement' type=dynamic origin=null diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.fir.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.fir.kt.txt new file mode 100644 index 00000000000..c3942e75ffd --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.fir.kt.txt @@ -0,0 +1,45 @@ +fun testMemberIncrementDecrement(d: dynamic) { + val t1: dynamic = ++d + val t2: dynamic = --d + val t3: dynamic = d.postfixIncr++ + val t4: dynamic = d.postfixDecr-- +} + +fun testSafeMemberIncrementDecrement(d: dynamic) { + val t1: dynamic = { // BLOCK + val tmp_0: dynamic = d + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> null + else -> { // BLOCK + val tmp_1: dynamic = tmp_0 + tmp_1.prefixIncr = ++tmp_1.prefixIncr + tmp_1.prefixIncr + } + } + } + val t2: dynamic = { // BLOCK + val tmp_2: dynamic = d + when { + EQEQ(arg0 = tmp_2, arg1 = null) -> null + else -> { // BLOCK + val tmp_3: dynamic = tmp_2 + tmp_3.prefixDecr = --tmp_3.prefixDecr + tmp_3.prefixDecr + } + } + } + val t3: dynamic = { // BLOCK + val tmp_4: dynamic = d + when { + EQEQ(arg0 = tmp_4, arg1 = null) -> null + else -> tmp_4.postfixIncr++ + } + } + val t4: dynamic = { // BLOCK + val tmp_5: dynamic = d + when { + EQEQ(arg0 = tmp_5, arg1 = null) -> null + else -> tmp_5.postfixDecr-- + } + } +} diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.kt b/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.kt index 09c4a3a2770..65ea7288537 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.kt @@ -1,7 +1,4 @@ // TARGET_BACKEND: JS_IR -// IGNORE_BACKEND_K2: JS_IR - -// FIR_IDENTICAL fun testMemberIncrementDecrement(d: dynamic) { val t1 = ++d.prefixIncr diff --git a/js/js.translator/testData/box/export/vararg.kt b/js/js.translator/testData/box/export/vararg.kt index 6e06606368b..3d55efbf003 100644 --- a/js/js.translator/testData/box/export/vararg.kt +++ b/js/js.translator/testData/box/export/vararg.kt @@ -1,9 +1,8 @@ -// IGNORE_BACKEND: JS -// IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 // EXPECTED_REACHABLE_NODES: 1270 // SKIP_MINIFICATION // RUN_PLAIN_BOX_FUNCTION // INFER_MAIN_MODULE +// WITH_STDLIB // MODULE: vararg // FILE: lib.kt diff --git a/js/js.translator/testData/box/expression/when/exhaustiveCheckException.kt b/js/js.translator/testData/box/expression/when/exhaustiveCheckException.kt index a671f923e3f..870f30c1a1d 100644 --- a/js/js.translator/testData/box/expression/when/exhaustiveCheckException.kt +++ b/js/js.translator/testData/box/expression/when/exhaustiveCheckException.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 +// ISSUE: KT-64652 // EXPECTED_REACHABLE_NODES: 1323 fun checkThrown(x: T, block: (T) -> Any?): Unit? { return try { @@ -93,4 +94,4 @@ fun box(): String { } ?: return "fail8" return "OK" -} \ No newline at end of file +}