JET-34 Require a return statement in a function with a block body

JET-77 Require a return type annotation for non-Unit returning functions with block bodies
This commit is contained in:
Andrey Breslav
2011-06-17 18:03:30 +04:00
parent c4eecea575
commit 94f00509e2
17 changed files with 303 additions and 144 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ fun foo() : Int {
<warning>?.</warning>equals(1) => 1
else => 1
}
when (<warning>x</warning>?:null) {
return when (<warning>x</warning>?:null) {
<error>.</error>equals(1) => 1
?.equals(1).equals(2) => 1
}