Move variable declaration into when: fix comment place

#KT-31362 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-05-23 09:34:48 +09:00
committed by Dmitry Gridin
parent b5c4f3ecc8
commit 3bca1a50e3
6 changed files with 54 additions and 0 deletions
@@ -0,0 +1,7 @@
fun foo(style: Int?): Int {
val a<caret> = style ?: 0 // comment
return when (a) {
0 -> 0
else -> a
}
}