Introduce/eliminate when subject intentions to keep line breaks and comments
This commit is contained in:
+13
@@ -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"
|
||||
}
|
||||
}
|
||||
+13
@@ -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"
|
||||
}
|
||||
}
|
||||
+13
@@ -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"
|
||||
}
|
||||
}
|
||||
+13
@@ -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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user