Allow returns without an explicit value.

This commit is contained in:
Bob Nystrom
2014-01-12 19:37:11 -08:00
parent cf623844c4
commit 8e8bb4b9b9
5 changed files with 28 additions and 6 deletions

View File

@ -1 +1,6 @@
var a = "ok"; IO.print(a) // expect: ok
var f = fn {
return "ok"
IO.print("bad")
}
IO.print(f.call) // expect: ok

View File

@ -0,0 +1,6 @@
var f = fn {
if (true) { return }
IO.print("bad")
}
IO.print(f.call) // expect: null

View File

@ -0,0 +1,6 @@
var f = fn {
return
IO.print("bad")
}
IO.print(f.call) // expect: null