Skip to content

Commit 457420d

Browse files
pyosSpace
authored andcommitted
Add tests for KT-48180
1 parent dd653ae commit 457420d

File tree

13 files changed

+213
-0
lines changed

13 files changed

+213
-0
lines changed

compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// NO_CHECK_LAMBDA_INLINING
2+
// FILE: 1.kt
3+
package test
4+
5+
inline fun foo(x: () -> String, y: () -> String, z: () -> String = { "" }) =
6+
x() + y() + z()
7+
8+
9+
// FILE: 2.kt
10+
import test.*
11+
12+
fun box(): String = foo("O"::toString, { "K" })
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// NO_CHECK_LAMBDA_INLINING
2+
// FILE: 1.kt
3+
package test
4+
5+
inline fun foo(unused: Long, x: () -> String, y: () -> String, z: () -> String = { "" }) =
6+
x() + y() + z()
7+
8+
9+
// FILE: 2.kt
10+
import test.*
11+
12+
fun box(): String {
13+
val O = "O"
14+
return foo(1L, { O }, { "K" })
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// NO_CHECK_LAMBDA_INLINING
2+
// FILE: 1.kt
3+
package test
4+
5+
// This reproduces KT-48180 without captures in the old backend.
6+
// 0 1 2 3 4
7+
inline fun foo(a: Int, b: () -> String, c: () -> String = { "K" }, d: Int = 1, e: Long = 1L) =
8+
b() + c()
9+
10+
// FILE: 2.kt
11+
import test.*
12+
13+
// This is why we can't compute offsets while generating arguments:
14+
// 0 2 [3 is c] 4 5
15+
fun box() = foo(e = 2L, b = { "O" }, d = 1, a = 1)

compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)