Skip to content

Commit

Permalink
Add regression test for KT-54707
Browse files Browse the repository at this point in the history
  • Loading branch information
udalov committed Oct 28, 2022
1 parent 7a25213 commit b1b18c2
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions compiler/testData/codegen/box/casts/kt54707.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS

fun box(): String =
g(arrayOf("O"))

fun g(x: Array<String>?): String =
x.orEmpty0().f { it + "K" }

inline fun <T> Array<out T>.f(lambda: (T) -> T): T =
lambda(this[0])

inline fun <reified T> Array<out T>?.orEmpty0(): Array<out T> =
this ?: (arrayOfNulls<T>(0) as Array<T>)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b1b18c2

Please sign in to comment.