Use of expressions instead of plain text when converting when's

This commit is contained in:
Valentin Kipyatkov
2015-05-06 12:16:39 +03:00
parent 66a90916fe
commit ada11ca5e9
14 changed files with 84 additions and 92 deletions
@@ -0,0 +1,10 @@
// ERROR: Expected condition of type kotlin.Boolean
// ERROR: Expected condition of type kotlin.Boolean
fun test(n: Int): String {
return <caret>when {
is String -> "String"
in 1..10 -> "1..10"
else -> "unknown"
}
}