Basic type patterns supported in when() expressions

This commit is contained in:
Andrey Breslav
2011-05-19 21:12:09 +04:00
parent 00e2c9dde3
commit 197c4a6fee
5 changed files with 51 additions and 3 deletions
+3
View File
@@ -2,6 +2,9 @@ fun foo() {
val s = ""
val x = 1
when (x) {
is <error>String</error> => 1
!is Int => 1
is Any? => 1
<error>s</error> => 1
1 => 1
1 + <error>a</error> => 1