Introduce/eliminate when subject intentions to keep line breaks and comments

This commit is contained in:
Valentin Kipyatkov
2016-02-11 21:48:52 +03:00
parent ce54a2d4bd
commit c9f26de9f5
7 changed files with 75 additions and 2 deletions
@@ -0,0 +1,13 @@
class Klass<T>
fun test(obj: Any): String {
return <caret>when (obj) {
is String -> "string" // return "string"
// it's an Int
is Int -> "int"
// otherwise
else -> "unknown"
}
}
@@ -0,0 +1,13 @@
class Klass<T>
fun test(obj: Any): String {
return when {
obj is String -> "string" // return "string"
// it's an Int
obj is Int -> "int"
// otherwise
else -> "unknown"
}
}
@@ -0,0 +1,13 @@
class Klass<T>
fun test(obj: Any): String {
return <caret>when {
obj is String -> "string" // return "string"
// it's an Int
obj is Int -> "int"
// otherwise
else -> "unknown"
}
}
@@ -0,0 +1,13 @@
class Klass<T>
fun test(obj: Any): String {
return when (obj) {
is String -> "string" // return "string"
// it's an Int
is Int -> "int"
// otherwise
else -> "unknown"
}
}