Inline variable: fix it works correctly for 'when' subject variable

#KT-29870 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-02-14 16:37:41 +09:00
committed by Vladimir Dolzhenko
parent d8ab046136
commit e56abcbb85
8 changed files with 52 additions and 3 deletions
@@ -0,0 +1,7 @@
fun test(value: Any): String {
return when (val <caret>v = value) {
is String -> "$v is String"
is Int -> "$v is Int"
else -> "$v"
}
}
@@ -0,0 +1,7 @@
fun test(value: Any): String {
return when (value) {
is String -> "$value is String"
is Int -> "$value is Int"
else -> "$value"
}
}