diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java index f67f97a6cdc..bd91d00a373 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java @@ -2014,6 +2014,12 @@ public class FirLightTreeJvmIrTextTestGenerated extends AbstractFirLightTreeJvmI runTest("compiler/testData/ir/irText/expressions/smartCastAside.kt"); } + @Test + @TestMetadata("smartCastAside2.kt") + public void testSmartCastAside2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCastAside2.kt"); + } + @Test @TestMetadata("smartCasts.kt") public void testSmartCasts() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java index a88fdc556c3..cf95375d8f0 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java @@ -2014,6 +2014,12 @@ public class FirPsiJvmIrTextTestGenerated extends AbstractFirPsiJvmIrTextTest { runTest("compiler/testData/ir/irText/expressions/smartCastAside.kt"); } + @Test + @TestMetadata("smartCastAside2.kt") + public void testSmartCastAside2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCastAside2.kt"); + } + @Test @TestMetadata("smartCasts.kt") public void testSmartCasts() throws Exception { diff --git a/compiler/testData/ir/irText/expressions/smartCastAside2.fir.ir.txt b/compiler/testData/ir/irText/expressions/smartCastAside2.fir.ir.txt new file mode 100644 index 00000000000..3a5dd481d58 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/smartCastAside2.fir.ir.txt @@ -0,0 +1,178 @@ +FILE fqName: fileName:/smartCastAside2.kt + FUN name:materialize visibility:public modality:FINAL () returnType:K of .materialize + TYPE_PARAMETER name:K index:0 variance: superTypes:[kotlin.Any?] reified:false + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun materialize (): K of .materialize declared in ' + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Nothing origin=EXCLEXCL + : kotlin.Nothing + arg0: CONST Null type=kotlin.Nothing? value=null + CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Foo> + TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Foo.Foo> + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Bar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Bar.Bar> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false + CONSTRUCTOR visibility:public <> () returnType:.Bar.Bar> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Bar modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.Bar.Bar>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Bar.Bar> + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:extFoo visibility:public modality:FINAL ($receiver:.Foo.extFoo>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Foo.extFoo> + BLOCK_BODY + FUN name:extBar visibility:public modality:FINAL ($receiver:.Bar.extBar>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false + $receiver: VALUE_PARAMETER name: type:.Bar.extBar> + BLOCK_BODY + FUN name:test_1 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Bar origin=CAST typeOperand=.Bar + GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Foo origin=CAST typeOperand=.Foo + TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + CALL 'public abstract fun foo (): kotlin.Unit declared in .Foo' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Foo origin=IMPLICIT_CAST typeOperand=.Foo + GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + CALL 'public abstract fun bar (): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + CALL 'public final fun extFoo (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + CALL 'public final fun extBar (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + FUN name:test_2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Bar? origin=CAST typeOperand=.Bar? + GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Foo? origin=CAST typeOperand=.Foo? + TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + CALL 'public abstract fun foo (): kotlin.Unit declared in .Foo' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Foo origin=IMPLICIT_CAST typeOperand=.Foo + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Any origin=EXCLEXCL + : kotlin.Any + arg0: GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + CALL 'public abstract fun bar (): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Any origin=EXCLEXCL + : kotlin.Any + arg0: GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + CALL 'public final fun extFoo (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Any origin=EXCLEXCL + : kotlin.Any + arg0: GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + CALL 'public final fun extBar (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Any origin=EXCLEXCL + : kotlin.Any + arg0: GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + FUN name:test_3 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Bar? origin=CAST typeOperand=.Bar? + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Foo? origin=CAST typeOperand=.Foo? + TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + CALL 'public abstract fun foo (): kotlin.Unit declared in .Foo' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Foo origin=IMPLICIT_CAST typeOperand=.Foo + BLOCK type=kotlin.Any origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any [val] + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + WHEN type=kotlin.Any 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: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CALL 'public final fun materialize (): K of .materialize declared in ' type=kotlin.Any origin=null + : kotlin.Any + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_0: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + CALL 'public abstract fun bar (): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + BLOCK type=kotlin.Any origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any [val] + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + WHEN type=kotlin.Any 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_1: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CALL 'public final fun materialize (): K of .materialize declared in ' type=kotlin.Any origin=null + : kotlin.Any + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_1: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + CALL 'public final fun extFoo (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: BLOCK type=kotlin.Any origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Any [val] + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + WHEN type=kotlin.Any 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: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CALL 'public final fun materialize (): K of .materialize declared in ' type=kotlin.Any origin=null + : kotlin.Any + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_2: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + CALL 'public final fun extBar (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: BLOCK type=kotlin.Any origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Any [val] + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + WHEN type=kotlin.Any 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_3: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CALL 'public final fun materialize (): K of .materialize declared in ' type=kotlin.Any origin=null + : kotlin.Any + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_3: kotlin.Any declared in .test_3' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/smartCastAside2.fir.kt.txt b/compiler/testData/ir/irText/expressions/smartCastAside2.fir.kt.txt new file mode 100644 index 00000000000..1d940b35972 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/smartCastAside2.fir.kt.txt @@ -0,0 +1,77 @@ +fun materialize(): K { + return CHECK_NOT_NULL(arg0 = null) +} + +interface Foo { + abstract fun foo() + +} + +abstract class Bar { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + abstract fun bar() + +} + +fun Foo.extFoo() { +} + +fun Bar.extBar() { +} + +fun test_1(x: Any) { + x as Bar /*~> Unit */ + x /*as Bar */ as Foo /*~> Unit */ + x /*as Foo */.foo() + x /*as Bar */.bar() + x.extFoo() + x.extBar() +} + +fun test_2(x: Any) { + x as Bar? /*~> Unit */ + x /*as Bar */ as Foo? /*~> Unit */ + CHECK_NOT_NULL(arg0 = x) /*as Foo */.foo() + CHECK_NOT_NULL(arg0 = x) /*as Bar */.bar() + CHECK_NOT_NULL(arg0 = x).extFoo() + CHECK_NOT_NULL(arg0 = x).extBar() +} + +fun test_3(x: Any) { + x as Bar? /*~> Unit */ + x /*as Bar */ as Foo? /*~> Unit */ + { // BLOCK + val tmp_0: Any = x + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> materialize() + else -> tmp_0 + } + } /*as Foo */.foo() + { // BLOCK + val tmp_1: Any = x + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> materialize() + else -> tmp_1 + } + } /*as Bar */.bar() + { // BLOCK + val tmp_2: Any = x + when { + EQEQ(arg0 = tmp_2, arg1 = null) -> materialize() + else -> tmp_2 + } + }.extFoo() + { // BLOCK + val tmp_3: Any = x + when { + EQEQ(arg0 = tmp_3, arg1 = null) -> materialize() + else -> tmp_3 + } + }.extBar() +} + diff --git a/compiler/testData/ir/irText/expressions/smartCastAside2.ir.txt b/compiler/testData/ir/irText/expressions/smartCastAside2.ir.txt new file mode 100644 index 00000000000..c37448c8c71 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/smartCastAside2.ir.txt @@ -0,0 +1,181 @@ +FILE fqName: fileName:/smartCastAside2.kt + FUN name:materialize visibility:public modality:FINAL () returnType:K of .materialize + TYPE_PARAMETER name:K index:0 variance: superTypes:[kotlin.Any?] reified:false + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun materialize (): K of .materialize declared in ' + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Nothing origin=EXCLEXCL + : kotlin.Nothing + arg0: CONST Null type=kotlin.Nothing? value=null + CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Foo> + TYPE_PARAMETER name:T index:0 variance:out superTypes:[kotlin.Any?] reified:false + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Foo.Foo>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Foo.Foo> + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Bar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Bar.Bar> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false + CONSTRUCTOR visibility:public <> () returnType:.Bar.Bar> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Bar modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.Bar.Bar>) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Bar.Bar> + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:extFoo visibility:public modality:FINAL ($receiver:.Foo.extFoo>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $receiver: VALUE_PARAMETER name: type:.Foo.extFoo> + BLOCK_BODY + FUN name:extBar visibility:public modality:FINAL ($receiver:.Bar.extBar>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] reified:false + $receiver: VALUE_PARAMETER name: type:.Bar.extBar> + BLOCK_BODY + FUN name:test_1 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Bar origin=CAST typeOperand=.Bar + GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Foo origin=CAST typeOperand=.Foo + GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + CALL 'public abstract fun foo (): kotlin.Unit declared in .Foo' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Foo origin=IMPLICIT_CAST typeOperand=.Foo + GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + CALL 'public abstract fun bar (): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + CALL 'public final fun extFoo (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: TYPE_OP type=.Foo origin=IMPLICIT_CAST typeOperand=.Foo + GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + CALL 'public final fun extBar (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + GET_VAR 'x: kotlin.Any declared in .test_1' type=kotlin.Any origin=null + FUN name:test_2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Bar? origin=CAST typeOperand=.Bar? + GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Foo? origin=CAST typeOperand=.Foo? + GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + CALL 'public abstract fun foo (): kotlin.Unit declared in .Foo' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Foo origin=IMPLICIT_CAST typeOperand=.Foo + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Any origin=EXCLEXCL + : kotlin.Any + arg0: GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + CALL 'public abstract fun bar (): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Any origin=EXCLEXCL + : kotlin.Any + arg0: GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + CALL 'public final fun extFoo (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: TYPE_OP type=.Foo origin=IMPLICIT_CAST typeOperand=.Foo + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Any origin=EXCLEXCL + : kotlin.Any + arg0: GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + CALL 'public final fun extBar (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Any origin=EXCLEXCL + : kotlin.Any + arg0: GET_VAR 'x: kotlin.Any declared in .test_2' type=kotlin.Any origin=null + FUN name:test_3 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Bar? origin=CAST typeOperand=.Bar? + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + TYPE_OP type=.Foo? origin=CAST typeOperand=.Foo? + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + CALL 'public abstract fun foo (): kotlin.Unit declared in .Foo' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Foo origin=IMPLICIT_CAST typeOperand=.Foo + BLOCK type=kotlin.Any origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any [val] + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + WHEN type=kotlin.Any 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: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CALL 'public final fun materialize (): K of .materialize declared in ' type=kotlin.Any origin=null + : kotlin.Any + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_0: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + CALL 'public abstract fun bar (): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null + $this: TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + BLOCK type=kotlin.Any origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Any [val] + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + WHEN type=kotlin.Any 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_1: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CALL 'public final fun materialize (): K of .materialize declared in ' type=kotlin.Any origin=null + : kotlin.Any + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_1: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + CALL 'public final fun extFoo (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: TYPE_OP type=.Foo origin=IMPLICIT_CAST typeOperand=.Foo + BLOCK type=kotlin.Any origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Any [val] + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + WHEN type=kotlin.Any 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: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CALL 'public final fun materialize (): K of .materialize declared in ' type=kotlin.Any origin=null + : kotlin.Any + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_2: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + CALL 'public final fun extBar (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: TYPE_OP type=.Bar origin=IMPLICIT_CAST typeOperand=.Bar + BLOCK type=kotlin.Any origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Any [val] + GET_VAR 'x: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + WHEN type=kotlin.Any 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_3: kotlin.Any declared in .test_3' type=kotlin.Any origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CALL 'public final fun materialize (): K of .materialize declared in ' type=kotlin.Any origin=null + : kotlin.Any + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_3: kotlin.Any declared in .test_3' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/smartCastAside2.kt b/compiler/testData/ir/irText/expressions/smartCastAside2.kt new file mode 100644 index 00000000000..54697ea87ea --- /dev/null +++ b/compiler/testData/ir/irText/expressions/smartCastAside2.kt @@ -0,0 +1,44 @@ +// ISSUE: KT-62863 + +fun materialize(): K = null!! + +interface Foo { + fun foo() +} + +abstract class Bar { + abstract fun bar() +} + +fun Foo.extFoo() {} +fun Bar.extBar() {} + +fun test_1(x: Any) { + x as Bar + x as Foo + + x.foo() + x.bar() + x.extFoo() + x.extBar() +} + +fun test_2(x: Any) { + x as Bar? + x as Foo? + + x!!.foo() + x!!.bar() + x!!.extFoo() + x!!.extBar() +} + +fun test_3(x: Any) { + x as Bar? + x as Foo? + + (x ?: materialize()).foo() + (x ?: materialize()).bar() + (x ?: materialize()).extFoo() + (x ?: materialize()).extBar() +} diff --git a/compiler/testData/ir/irText/expressions/smartCastAside2.kt.txt b/compiler/testData/ir/irText/expressions/smartCastAside2.kt.txt new file mode 100644 index 00000000000..b470d27809b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/smartCastAside2.kt.txt @@ -0,0 +1,77 @@ +fun materialize(): K { + return CHECK_NOT_NULL(arg0 = null) +} + +interface Foo { + abstract fun foo() + +} + +abstract class Bar { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + abstract fun bar() + +} + +fun Foo.extFoo() { +} + +fun Bar.extBar() { +} + +fun test_1(x: Any) { + x as Bar /*~> Unit */ + x as Foo /*~> Unit */ + x /*as Foo */.foo() + x /*as Bar */.bar() + x /*as Foo */.extFoo() + x /*as Bar */.extBar() +} + +fun test_2(x: Any) { + x as Bar? /*~> Unit */ + x as Foo? /*~> Unit */ + CHECK_NOT_NULL(arg0 = x) /*as Foo */.foo() + CHECK_NOT_NULL(arg0 = x) /*as Bar */.bar() + CHECK_NOT_NULL(arg0 = x) /*as Foo */.extFoo() + CHECK_NOT_NULL(arg0 = x) /*as Bar */.extBar() +} + +fun test_3(x: Any) { + x as Bar? /*~> Unit */ + x as Foo? /*~> Unit */ + { // BLOCK + val tmp_0: Any = x + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> materialize() + else -> tmp_0 + } + } /*as Foo */.foo() + { // BLOCK + val tmp_1: Any = x + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> materialize() + else -> tmp_1 + } + } /*as Bar */.bar() + { // BLOCK + val tmp_2: Any = x + when { + EQEQ(arg0 = tmp_2, arg1 = null) -> materialize() + else -> tmp_2 + } + } /*as Foo */.extFoo() + { // BLOCK + val tmp_3: Any = x + when { + EQEQ(arg0 = tmp_3, arg1 = null) -> materialize() + else -> tmp_3 + } + } /*as Bar */.extBar() +} + diff --git a/compiler/testData/ir/irText/expressions/smartCastAside2.sig.kt.txt b/compiler/testData/ir/irText/expressions/smartCastAside2.sig.kt.txt new file mode 100644 index 00000000000..3650e5db5cb --- /dev/null +++ b/compiler/testData/ir/irText/expressions/smartCastAside2.sig.kt.txt @@ -0,0 +1,71 @@ +// CHECK: +// Mangled name: Bar +// Public signature: /Bar|null[0] +abstract class Bar { + // CHECK: + // Mangled name: Bar#(){} + // Public signature: /Bar.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK: + // Mangled name: Bar#bar(){} + // Public signature: /Bar.bar|496682602797471549[0] + // Public signature debug description: bar(){} + abstract fun bar(): Unit + +} + +// CHECK: +// Mangled name: Foo +// Public signature: /Foo|null[0] +interface Foo { + + // CHECK: + // Mangled name: Foo#foo(){} + // Public signature: /Foo.foo|-1041209573719867811[0] + // Public signature debug description: foo(){} + abstract fun foo(): Unit + +} + +// CHECK: +// Mangled name: #extBar@Bar<0:0>(){0§} +// Public signature: /extBar|8642037032021446167[0] +// Public signature debug description: extBar@Bar<0:0>(){0§} +fun Bar.extBar(): Unit + +// CHECK: +// Mangled name: #extFoo@Foo<0:0>(){0§} +// Public signature: /extFoo|-4576860830521619991[0] +// Public signature debug description: extFoo@Foo<0:0>(){0§} +fun Foo.extFoo(): Unit + +// CHECK JVM_IR: +// Mangled name: #materialize(){0§}0:0 +// Public signature: /materialize|4529465674657197020[0] +// Public signature debug description: materialize(){0§}0:0 +// CHECK JS_IR NATIVE: +// Mangled name: #materialize(){0§} +// Public signature: /materialize|5983574876741311895[0] +// Public signature debug description: materialize(){0§} +fun materialize(): K + +// CHECK: +// Mangled name: #test_1(kotlin.Any){} +// Public signature: /test_1|-8508867973894375926[0] +// Public signature debug description: test_1(kotlin.Any){} +fun test_1(x: Any): Unit + +// CHECK: +// Mangled name: #test_2(kotlin.Any){} +// Public signature: /test_2|4713680415350302923[0] +// Public signature debug description: test_2(kotlin.Any){} +fun test_2(x: Any): Unit + +// CHECK: +// Mangled name: #test_3(kotlin.Any){} +// Public signature: /test_3|-963080351911937203[0] +// Public signature debug description: test_3(kotlin.Any){} +fun test_3(x: Any): Unit + diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java index 675d8a45b45..b81c9d0ad7a 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java @@ -2014,6 +2014,12 @@ public class ClassicJvmIrTextTestGenerated extends AbstractClassicJvmIrTextTest runTest("compiler/testData/ir/irText/expressions/smartCastAside.kt"); } + @Test + @TestMetadata("smartCastAside2.kt") + public void testSmartCastAside2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCastAside2.kt"); + } + @Test @TestMetadata("smartCasts.kt") public void testSmartCasts() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java index fbf6437a8e1..c1cfcc9f610 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java @@ -1538,6 +1538,11 @@ public class KlibIrTextTestCaseGenerated extends AbstractKlibIrTextTestCase { runTest("compiler/testData/ir/irText/expressions/smartCastAside.kt"); } + @TestMetadata("smartCastAside2.kt") + public void testSmartCastAside2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCastAside2.kt"); + } + @TestMetadata("smartCasts.kt") public void testSmartCasts() throws Exception { runTest("compiler/testData/ir/irText/expressions/smartCasts.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java index 6b0daedee29..fff2fe04aab 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java @@ -1762,6 +1762,12 @@ public class FirLightTreeJsIrTextTestGenerated extends AbstractFirLightTreeJsIrT runTest("compiler/testData/ir/irText/expressions/smartCastAside.kt"); } + @Test + @TestMetadata("smartCastAside2.kt") + public void testSmartCastAside2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCastAside2.kt"); + } + @Test @TestMetadata("smartCasts.kt") public void testSmartCasts() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java index cc8f2cfb6fa..8c4fbf3528b 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java @@ -1762,6 +1762,12 @@ public class FirPsiJsIrTextTestGenerated extends AbstractFirPsiJsIrTextTest { runTest("compiler/testData/ir/irText/expressions/smartCastAside.kt"); } + @Test + @TestMetadata("smartCastAside2.kt") + public void testSmartCastAside2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCastAside2.kt"); + } + @Test @TestMetadata("smartCasts.kt") public void testSmartCasts() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java index 4c42ea183b9..efdde6805a9 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java @@ -1762,6 +1762,12 @@ public class ClassicJsIrTextTestGenerated extends AbstractClassicJsIrTextTest { runTest("compiler/testData/ir/irText/expressions/smartCastAside.kt"); } + @Test + @TestMetadata("smartCastAside2.kt") + public void testSmartCastAside2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCastAside2.kt"); + } + @Test @TestMetadata("smartCasts.kt") public void testSmartCasts() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java index e45c34f25e1..5c6d167cb3e 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java @@ -1762,6 +1762,12 @@ public class ClassicNativeIrTextTestGenerated extends AbstractClassicNativeIrTex runTest("compiler/testData/ir/irText/expressions/smartCastAside.kt"); } + @Test + @TestMetadata("smartCastAside2.kt") + public void testSmartCastAside2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCastAside2.kt"); + } + @Test @TestMetadata("smartCasts.kt") public void testSmartCasts() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java index fc579559aef..2be8c9e0581 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java @@ -1762,6 +1762,12 @@ public class FirLightTreeNativeIrTextTestGenerated extends AbstractFirLightTreeN runTest("compiler/testData/ir/irText/expressions/smartCastAside.kt"); } + @Test + @TestMetadata("smartCastAside2.kt") + public void testSmartCastAside2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCastAside2.kt"); + } + @Test @TestMetadata("smartCasts.kt") public void testSmartCasts() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java index 2c666d8ed60..38fd2af1d66 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java @@ -1762,6 +1762,12 @@ public class FirPsiNativeIrTextTestGenerated extends AbstractFirPsiNativeIrTextT runTest("compiler/testData/ir/irText/expressions/smartCastAside.kt"); } + @Test + @TestMetadata("smartCastAside2.kt") + public void testSmartCastAside2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCastAside2.kt"); + } + @Test @TestMetadata("smartCasts.kt") public void testSmartCasts() throws Exception {