Tests for bug in CFA: no return in when() is now detected

This commit is contained in:
Andrey Breslav
2013-12-02 22:49:35 +04:00
parent ec39105183
commit b15b075484
6 changed files with 56 additions and 1 deletions
@@ -0,0 +1,6 @@
fun illegalWhenBlock(a: Any): Int {
when(a) {
is Int -> return a
is String -> return a.length
}
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>