KT4385 Bug Fix for Unnecessary Parentheses in WhenToIfIntention

This commit is contained in:
Lingzhang
2014-03-13 21:26:03 -04:00
parent 4937812414
commit 877b9f2d99
4 changed files with 31 additions and 1 deletions
@@ -0,0 +1,13 @@
class G {
fun cat(x: Int, y: Int): Int {
return x + y
}
}
fun test(x: Int, y: Int): String {
when<caret> (G.cat(x, y)) {
1 -> return "one"
2 -> return "two"
else -> return "big"
}
}
@@ -0,0 +1,11 @@
class G {
fun cat(x: Int, y: Int): Int {
return x + y
}
}
fun test(x: Int, y: Int): String {
if (G.cat(x, y) == 1) return "one"
else if (G.cat(x, y) == 2) return "two"
else return "big"
}