explicitly return from blocks

instead of last statement being expression value

closes #629
This commit is contained in:
Andrew Kelley
2017-12-22 00:50:30 -05:00
parent 8bc523219c
commit d917815d81
114 changed files with 1203 additions and 1231 deletions

View File

@@ -22,7 +22,7 @@ test "arrays" {
assert(getArrayLen(array) == 5);
}
fn getArrayLen(a: []const u32) -> usize {
a.len
return a.len;
}
test "void arrays" {
@@ -41,7 +41,7 @@ test "array literal" {
}
test "array dot len const expr" {
assert(comptime {some_array.len == 4});
assert(comptime x: {break :x some_array.len == 4;});
}
const ArrayDotLenConstExpr = struct {