JVM add tests for KT-49615

This commit is contained in:
Dmitry Petrov
2021-11-11 13:35:59 +03:00
committed by teamcityserver
parent 7e633cf217
commit 8b066fd345
6 changed files with 79 additions and 0 deletions
@@ -0,0 +1,17 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
fun builder(c: suspend () -> Unit): Int = 42
@JvmInline
value class IC(val s: String)
fun box(): String {
builder {
listOf(
IC("O".plus("").sumOf { a: Char -> 1.toULong() }.rangeTo(67.toULong()).first.toString(36)),
IC("")
)
}
return "OK"
}
@@ -0,0 +1,16 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
@JvmInline
value class IC(val s: String)
fun asAny(a: Any) = a
fun box(): String {
val t = asAny(
IC("O".plus("").sumOf { a: Char -> 1.toULong() }.rangeTo(67.toULong()).first.toString(36))
).toString()
if (t != "IC(s=1)")
return "Failed: t=$t"
return "OK"
}