diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index a5992cd844f..67d9a58c0ca 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -1222,7 +1222,9 @@ class Fir2IrVisitor( override fun visitCatch(catch: FirCatch, data: Any?): IrElement { return catch.convertWithOffsets { startOffset, endOffset -> - val catchParameter = declarationStorage.createIrVariable(catch.parameter, conversionScope.parentFromStack()) + val catchParameter = declarationStorage.createIrVariable( + catch.parameter, conversionScope.parentFromStack(), IrDeclarationOrigin.CATCH_PARAMETER + ) IrCatchImpl(startOffset, endOffset, catchParameter, catch.block.convertToIrBlock()) } } diff --git a/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.fir.ir.txt b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.fir.ir.txt deleted file mode 100644 index c5f96f4b5c7..00000000000 --- a/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.fir.ir.txt +++ /dev/null @@ -1,14 +0,0 @@ -FILE fqName: fileName:/catchParameterInTopLevelProperty.kt - PROPERTY name:test visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Unit visibility:private [final,static] - EXPRESSION_BODY - TRY type=kotlin.Unit - try: BLOCK type=kotlin.Unit origin=null - CATCH parameter=val e: kotlin.Throwable [val] declared in .test - VAR name:e type:kotlin.Throwable [val] - BLOCK type=kotlin.Unit origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Unit declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Unit visibility:private [final,static]' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.fir.kt.txt b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.fir.kt.txt deleted file mode 100644 index 1be53a5cc95..00000000000 --- a/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.fir.kt.txt +++ /dev/null @@ -1,7 +0,0 @@ -val test: Unit - field = try { // BLOCK - } - catch (e: Throwable){ // BLOCK - } - - get diff --git a/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt index b0b732e0923..973802ffdee 100644 --- a/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt +++ b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL val test = try { } catch (e : Throwable) { } \ No newline at end of file diff --git a/compiler/testData/ir/irText/expressions/catchParameterAccess.fir.ir.txt b/compiler/testData/ir/irText/expressions/catchParameterAccess.fir.ir.txt index a1778c5de59..189b3e13b94 100644 --- a/compiler/testData/ir/irText/expressions/catchParameterAccess.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/catchParameterAccess.fir.ir.txt @@ -8,7 +8,7 @@ FILE fqName: fileName:/catchParameterAccess.kt CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'f: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION CATCH parameter=val e: java.lang.Exception [val] declared in .test - VAR name:e type:java.lang.Exception [val] + VAR CATCH_PARAMETER name:e type:java.lang.Exception [val] BLOCK type=kotlin.Nothing origin=null THROW type=kotlin.Nothing GET_VAR 'val e: java.lang.Exception [val] declared in .test' type=java.lang.Exception origin=null diff --git a/compiler/testData/ir/irText/expressions/kt48806.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt48806.fir.ir.txt index 8656c31389c..daf49c89170 100644 --- a/compiler/testData/ir/irText/expressions/kt48806.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt48806.fir.ir.txt @@ -13,7 +13,7 @@ FILE fqName: fileName:/kt48806.kt THROW type=kotlin.Nothing CONSTRUCTOR_CALL 'public constructor () declared in java.lang.RuntimeException' type=java.lang.RuntimeException origin=null CATCH parameter=val e: java.lang.Exception [val] declared in .A.test_1 - VAR name:e type:java.lang.Exception [val] + VAR CATCH_PARAMETER name:e type:java.lang.Exception [val] BLOCK type=kotlin.Int origin=null CONST Int type=kotlin.Int value=1 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int @@ -30,7 +30,7 @@ FILE fqName: fileName:/kt48806.kt try: BLOCK type=kotlin.Int origin=null CONST Int type=kotlin.Int value=1 CATCH parameter=val e: java.lang.Exception [val] declared in .A.test_2 - VAR name:e type:java.lang.Exception [val] + VAR CATCH_PARAMETER name:e type:java.lang.Exception [val] BLOCK type=kotlin.Nothing origin=null THROW type=kotlin.Nothing CONSTRUCTOR_CALL 'public constructor () declared in java.lang.RuntimeException' type=java.lang.RuntimeException origin=null diff --git a/compiler/testData/ir/irText/expressions/tryCatch.fir.ir.txt b/compiler/testData/ir/irText/expressions/tryCatch.fir.ir.txt index a3940df5ec8..e5585dec7a6 100644 --- a/compiler/testData/ir/irText/expressions/tryCatch.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/tryCatch.fir.ir.txt @@ -5,7 +5,7 @@ FILE fqName: fileName:/tryCatch.kt try: BLOCK type=kotlin.Unit origin=null CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null CATCH parameter=val e: kotlin.Throwable [val] declared in .test1 - VAR name:e type:kotlin.Throwable [val] + VAR CATCH_PARAMETER name:e type:kotlin.Throwable [val] BLOCK type=kotlin.Unit origin=null CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null finally: BLOCK type=kotlin.Unit origin=null @@ -18,7 +18,7 @@ FILE fqName: fileName:/tryCatch.kt CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null CONST Int type=kotlin.Int value=42 CATCH parameter=val e: kotlin.Throwable [val] declared in .test2 - VAR name:e type:kotlin.Throwable [val] + VAR CATCH_PARAMETER name:e type:kotlin.Throwable [val] BLOCK type=kotlin.Int origin=null CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null CONST Int type=kotlin.Int value=24 diff --git a/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.ir.txt b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.ir.txt index fcdb0a0e37f..8fb638dd2f3 100644 --- a/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.ir.txt @@ -14,6 +14,6 @@ FILE fqName: fileName:/tryCatchWithImplicitCast.kt TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String GET_VAR 'a: kotlin.Any declared in .testImplicitCast' type=kotlin.Any origin=null CATCH parameter=val e: kotlin.Throwable [val] declared in .testImplicitCast - VAR name:e type:kotlin.Throwable [val] + VAR CATCH_PARAMETER name:e type:kotlin.Throwable [val] BLOCK type=kotlin.String origin=null CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.ir.txt b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.ir.txt index 8b9423b81ac..d66598790b4 100644 --- a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.ir.txt @@ -14,7 +14,7 @@ FILE fqName: fileName:/FlushFromAnonymous.kt TRY type=kotlin.Unit try: BLOCK type=kotlin.Unit origin=null CATCH parameter=val e: kotlin.Throwable [val] declared in .Serializer.serialize - VAR name:e type:kotlin.Throwable [val] + VAR CATCH_PARAMETER name:e type:kotlin.Throwable [val] BLOCK type=kotlin.Unit origin=null CALL 'public open fun flush (): kotlin.Unit [fake_override] declared in .Serializer.createMessageCollector.' type=kotlin.Unit origin=null $this: GET_VAR 'val messageCollector: .Serializer.createMessageCollector. [val] declared in .Serializer.serialize' type=.Serializer.createMessageCollector. origin=null