diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt index 61b5efb936b..9763b3d17c5 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt @@ -61,7 +61,7 @@ class BodyGenerator( val irBody = statementGenerator.generateStatement(ktBody) irBlockBody.statements.add( if (ktBody.isUsedAsExpression(context.bindingContext) && irBody is IrExpression) - generateReturnExpression(irBody.startOffset, irBody.endOffset, irBody) + generateReturnExpression(irBody.endOffset, irBody.endOffset, irBody) else irBody ) diff --git a/compiler/testData/debug/stepping/functionInAnotherFile.kt b/compiler/testData/debug/stepping/functionInAnotherFile.kt index cf1a0fcc520..f5ab4b559da 100644 --- a/compiler/testData/debug/stepping/functionInAnotherFile.kt +++ b/compiler/testData/debug/stepping/functionInAnotherFile.kt @@ -20,9 +20,6 @@ fun bar(x: Int) = foo(x) } -// IGNORE_BACKEND: JVM_IR - -// IR backend has bar().12 replaced as bar().8 for returning bar() function result. // LINENUMBERS // TestKt.box():4 // FooKt.foo(int):4 diff --git a/compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.txt b/compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.txt index 95d347897b3..0d2791c0f39 100644 --- a/compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.txt +++ b/compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.txt @@ -24,7 +24,7 @@ @2:0..8:1 VALUE_PARAMETER name: type:kotlin.Any @10:0..18 FUN name:foo visibility:public modality:FINAL <> () returnType:test.Host @10:12..18 BLOCK_BODY - @10:12..18 RETURN type=kotlin.Nothing from='public final fun foo (): test.Host declared in test' + @10:18..18 RETURN type=kotlin.Nothing from='public final fun foo (): test.Host declared in test' @10:12..18 CONSTRUCTOR_CALL 'public constructor () [primary] declared in test.Host' type=test.Host origin=null @12:0..14:1 FUN name:test2 visibility:public modality:FINAL <> ($receiver:test.Host) returnType:kotlin.Unit @12:4..8 VALUE_PARAMETER name: type:test.Host diff --git a/compiler/testData/ir/sourceRanges/comments.txt b/compiler/testData/ir/sourceRanges/comments.txt index b082c2d76b5..9dd43c01f51 100644 --- a/compiler/testData/ir/sourceRanges/comments.txt +++ b/compiler/testData/ir/sourceRanges/comments.txt @@ -31,7 +31,7 @@ @27:8..25 FUN name: visibility:public modality:FINAL <> ($this:.Foo) returnType:kotlin.Int @27:8..25 VALUE_PARAMETER name: type:.Foo @27:16..25 BLOCK_BODY - @27:16..25 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Foo' + @27:25..25 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Foo' @27:16..25 CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PLUS @27:16..21 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null @27:16..21 GET_VAR ': .Foo declared in .Foo.' type=.Foo origin=null diff --git a/compiler/testData/ir/sourceRanges/declarations/classProperties.txt b/compiler/testData/ir/sourceRanges/declarations/classProperties.txt index 9274d152c60..f05e06c7df0 100644 --- a/compiler/testData/ir/sourceRanges/declarations/classProperties.txt +++ b/compiler/testData/ir/sourceRanges/declarations/classProperties.txt @@ -49,25 +49,25 @@ @23:14..24 FUN name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int @23:14..24 VALUE_PARAMETER name: type:test.Test @23:22..24 BLOCK_BODY - @23:22..24 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @23:24..24 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' @23:22..24 CONST Int type=kotlin.Int value=42 @26:4..27:18 PROPERTY name:test5 visibility:public modality:FINAL [val] @27:8..18 FUN name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int @27:8..18 VALUE_PARAMETER name: type:test.Test @27:16..18 BLOCK_BODY - @27:16..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @27:18..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' @27:16..18 CONST Int type=kotlin.Int value=42 @30:4..34:18 PROPERTY name:test6 visibility:public modality:FINAL [val] @34:8..18 FUN name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int @34:8..18 VALUE_PARAMETER name: type:test.Test @34:16..18 BLOCK_BODY - @34:16..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @34:18..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' @34:16..18 CONST Int type=kotlin.Int value=42 @37:4..41:18 PROPERTY name:test7 visibility:public modality:FINAL [val] @41:8..18 FUN name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int @38:8..41:18 VALUE_PARAMETER name: type:test.Test @41:16..18 BLOCK_BODY - @41:16..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @41:18..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' @41:16..18 CONST Int type=kotlin.Int value=42 @44:4..18 PROPERTY name:test8 visibility:public modality:FINAL [var] @44:4..18 FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Int visibility:private diff --git a/compiler/testData/ir/sourceRanges/declarations/topLevelProperties.txt b/compiler/testData/ir/sourceRanges/declarations/topLevelProperties.txt index d66574efab6..010b0d779cc 100644 --- a/compiler/testData/ir/sourceRanges/declarations/topLevelProperties.txt +++ b/compiler/testData/ir/sourceRanges/declarations/topLevelProperties.txt @@ -34,22 +34,22 @@ @22:0..20 PROPERTY name:test4 visibility:public modality:FINAL [val] @22:10..20 FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int @22:18..20 BLOCK_BODY - @22:18..20 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @22:20..20 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' @22:18..20 CONST Int type=kotlin.Int value=42 @25:0..26:14 PROPERTY name:test5 visibility:public modality:FINAL [val] @26:4..14 FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int @26:12..14 BLOCK_BODY - @26:12..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @26:14..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' @26:12..14 CONST Int type=kotlin.Int value=42 @29:0..33:14 PROPERTY name:test6 visibility:public modality:FINAL [val] @33:4..14 FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int @33:12..14 BLOCK_BODY - @33:12..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @33:14..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' @33:12..14 CONST Int type=kotlin.Int value=42 @36:0..40:14 PROPERTY name:test7 visibility:public modality:FINAL [val] @40:4..14 FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int @40:12..14 BLOCK_BODY - @40:12..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @40:14..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' @40:12..14 CONST Int type=kotlin.Int value=42 @43:0..14 PROPERTY name:test8 visibility:public modality:FINAL [var] @43:0..14 FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Int visibility:private [static]