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
@@ -29,5 +29,5 @@ fun box() : String {
val p4 = P4(240, y)
if (p4.x + p4.y != 239) return "FAIL #7"
"OK"
return "OK"
}
@@ -5,5 +5,5 @@ fun concat(l: List<String>): String? {
for(s in l) {
sb.append(s)
}
sb.toString()
return sb.toString()
}
@@ -3,5 +3,5 @@ fun concat(l: Array<String>): String? {
for(s in l) {
sb.append(s)
}
sb.toString()
return sb.toString()
}
+1 -1
View File
@@ -2,5 +2,5 @@ fun f(a:Int) : Int {
val x = 42
val y = 50
y
return y
}