Returns forbidden outside functions

This commit is contained in:
Andrey Breslav
2011-06-17 18:20:24 +04:00
parent 94f00509e2
commit 03460e2bcc
3 changed files with 10 additions and 4 deletions
@@ -9,6 +9,10 @@ fun test1() : Any = {<error>return</error>}
fun test2() : Any = @a {return@a 1}
fun test3() : Any { <error>return</error> }
fun bbb() {
return <error>1</error>
}
fun foo(expr: StringBuilder): Int {
val c = 'a'
when(c) {
@@ -105,3 +109,5 @@ fun blockReturnValueTypeMatch() : Int {
return 1
else return <error>1.0</error>
}
val a = <error>return 1</error>