[PSI2IR] Sync start and end offsets on PSI and FIR for an implicit return inside lambdas

This commit is contained in:
Artem Kobzar
2024-02-27 19:25:24 +00:00
committed by Space Team
parent a582bf22e3
commit 02a78051aa
39 changed files with 20 additions and 2865 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_K2: WASM
// FILE: test.kt
fun <T> eval(f: () -> T) = f()
@@ -31,7 +31,7 @@ fun box() {
// test.kt:1 $box
// test.kt:7 $box
// test.kt:4 $eval (27, 30)
// test.kt:8 $box$lambda.invoke (8, 8, 8, 8)
// test.kt:8 $box$lambda.invoke (8, 8, 8, 8, 12)
// String.kt:141 $kotlin.stringLiteral (17, 28, 17)
// Array.kt:59 $kotlin.Array.get (19, 26, 34, 8)
// ThrowHelpers.kt:29 $kotlin.wasm.internal.rangeCheck (6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19)
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_K2: WASM
// FILE: test.kt
fun box() {
@@ -19,7 +19,7 @@ fun box() {
// EXPECTATIONS WASM
// test.kt:1 $box
// test.kt:5 $box
// test.kt:6 $box$lambda.invoke (8, 8, 8, 8)
// test.kt:6 $box$lambda.invoke (8, 8, 8, 8, 12)
// String.kt:141 $kotlin.stringLiteral (17, 28, 17)
// Array.kt:59 $kotlin.Array.get (19, 26, 34, 8)
// ThrowHelpers.kt:29 $kotlin.wasm.internal.rangeCheck (6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19)
+3 -3
View File
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_K2: WASM
// FILE: test.kt
inline fun foo(stringMaker: () -> String): String {
@@ -30,7 +30,7 @@ fun box(): String {
// EXPECTATIONS WASM
// test.kt:1 $box__JsExportAdapter
// test.kt:9 $box (4, 10, 10, 10, 10)
// test.kt:9 $box (4, 10, 10, 10, 10, 15)
// test.kt:5 $box (11, 11, 4, 11, 11, 4)
// String.kt:141 $kotlin.stringLiteral (17, 28, 17, 17, 28, 17, 17, 28, 17)
// Array.kt:59 $kotlin.Array.get (19, 26, 34, 8, 19, 26, 34, 8, 19, 26, 34, 8)
@@ -46,7 +46,7 @@ fun box(): String {
// Array.kt:76 $kotlin.Array.set (5, 5)
// String.kt:149 $kotlin.stringLiteral (11, 4, 11, 4)
// test.kt:10 $box
// test.kt:11 $box (8, 8, 8, 8)
// test.kt:11 $box (8, 8, 8, 8, 12)
// test.kt:14 $box (11, 11, 11, 11, 4)
// String.kt:143 $kotlin.stringLiteral (15, 8)
// ExternalWrapper.kt:200 $kotlin.wasm.internal.kotlinToJsStringAdapter
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_K2: WASM
// FILE: test.kt
inline fun foo(stringMaker: () -> String = { "OK" }): String {
return stringMaker()
@@ -37,7 +37,7 @@ fun box(): String {
// test.kt:1 $box__JsExportAdapter
// test.kt:15 $box
// test.kt:4 $box (11, 11, 4)
// test.kt:3 $box (45, 45, 45, 45)
// test.kt:3 $box (45, 45, 45, 45, 49)
// String.kt:141 $kotlin.stringLiteral (17, 28, 17, 17, 28, 17, 17, 28, 17)
// Array.kt:59 $kotlin.Array.get (19, 26, 34, 8, 19, 26, 34, 8, 19, 26, 34, 8)
// ThrowHelpers.kt:29 $kotlin.wasm.internal.rangeCheck (6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19)
@@ -53,7 +53,7 @@ fun box(): String {
// String.kt:149 $kotlin.stringLiteral (11, 4)
// test.kt:16 $box
// test.kt:11 $box (11, 11, 4)
// test.kt:8 $box (4, 4, 4, 4)
// test.kt:8 $box (4, 4, 4, 4, 8)
// String.kt:143 $kotlin.stringLiteral (15, 8, 15, 8)
// test.kt:17 $box (11, 11, 11, 11, 4)
// ExternalWrapper.kt:200 $kotlin.wasm.internal.kotlinToJsStringAdapter
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_K2: WASM
// FILE: test.kt
@@ -32,5 +32,5 @@ inline fun lookAtMe(f: () -> Int) {
// test.kt:6 $box
// test.kt:12 $box
// test.kt:13 $box (4, 8, 4, 4)
// test.kt:7 $box (8, 8)
// test.kt:7 $box (8, 10)
// test.kt:9 $box
+2 -3
View File
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_K2: WASM
// FILE: test.kt
fun box(): String {
@@ -26,7 +26,7 @@ fun box(): String {
// test.kt:5 $box
// Standard.kt:41 $box (4, 4)
// Standard.kt:44 $box (11, 11, 11, 4, 11, 11, 11, 4)
// Standard.kt:2 $box (72, 72, 72, 72)
// Standard.kt:2 $box (46, 46, 46, 46, 55, 76, 76, 76, 76, 85)
// String.kt:141 $kotlin.stringLiteral (17, 28, 17, 17, 28, 17, 17, 28, 17)
// Array.kt:59 $kotlin.Array.get (19, 26, 34, 8, 19, 26, 34, 8, 19, 26, 34, 8)
// ThrowHelpers.kt:29 $kotlin.wasm.internal.rangeCheck (6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19, 6, 14, 6, 19, 28, 19)
@@ -41,7 +41,6 @@ fun box(): String {
// Array.kt:76 $kotlin.Array.set
// String.kt:149 $kotlin.stringLiteral (11, 4)
// test.kt:6 $box
// Standard.kt:3 $box (16, 16, 16, 16)
// String.kt:143 $kotlin.stringLiteral (15, 8, 15, 8)
// test.kt:9 $box (11, 11, 11, 11, 4)
// ExternalWrapper.kt:200 $kotlin.wasm.internal.kotlinToJsStringAdapter