[FIR2IR] Properly insert casts for smartcasts in argument position
Previously cast inserter didn't consider expected type for arguments of function calls ^KT-63257 Fixed
This commit is contained in:
committed by
Space Team
parent
c70a6425f5
commit
8578a0bf6a
@@ -0,0 +1,22 @@
|
||||
// ISSUE: KT-62863
|
||||
// FIR_IDENTICAL
|
||||
// WITH_STDLIB
|
||||
// DUMP_IR
|
||||
|
||||
class Some<V : Any>(val map: Map<String, V>) {
|
||||
fun test(key: String): String {
|
||||
return when (val value = map.getValue(key)) {
|
||||
is String -> addK(value)
|
||||
else -> "Fail: $value"
|
||||
}
|
||||
}
|
||||
|
||||
fun addK(s: String): String {
|
||||
return s + "K"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val x = Some<String>(mapOf("key" to "O"))
|
||||
return x.test("key")
|
||||
}
|
||||
Reference in New Issue
Block a user