diff options
| author | Jimmi Holst Christensen <jimmiholstchristensen@gmail.com> | 2018-10-15 09:51:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-15 09:51:15 -0400 |
| commit | 378d3e44034e817093966ea42c2940d6a0482dd8 (patch) | |
| tree | fe5f454097e1627b1afc65aebfb815dd70a7576d /test/cases/syntax.zig | |
| parent | 822d4fa216ea8f598e4a9d53161800494f449a94 (diff) | |
| download | zig-378d3e44034e817093966ea42c2940d6a0482dd8.tar.gz zig-378d3e44034e817093966ea42c2940d6a0482dd8.zip | |
Solve the return type ambiguity (#1628)
Changed container and initializer syntax
* <container> { ... } -> <container> . { ... }
* <exrp> { ... } -> <expr> . { ...}
Diffstat (limited to 'test/cases/syntax.zig')
| -rw-r--r-- | test/cases/syntax.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/cases/syntax.zig b/test/cases/syntax.zig index b497b060c4..c54172fd10 100644 --- a/test/cases/syntax.zig +++ b/test/cases/syntax.zig @@ -1,16 +1,16 @@ // Test trailing comma syntax // zig fmt: off -const struct_trailing_comma = struct { x: i32, y: i32, }; -const struct_no_comma = struct { x: i32, y: i32 }; -const struct_fn_no_comma = struct { fn m() void {} y: i32 }; +const struct_trailing_comma = struct.{ x: i32, y: i32, }; +const struct_no_comma = struct.{ x: i32, y: i32 }; +const struct_fn_no_comma = struct.{ fn m() void {} y: i32 }; -const enum_no_comma = enum { A, B }; +const enum_no_comma = enum.{ A, B }; fn container_init() void { - const S = struct { x: i32, y: i32 }; - _ = S { .x = 1, .y = 2 }; - _ = S { .x = 1, .y = 2, }; + const S = struct.{ x: i32, y: i32 }; + _ = S.{ .x = 1, .y = 2 }; + _ = S.{ .x = 1, .y = 2, }; } fn switch_cases(x: i32) void { @@ -37,7 +37,7 @@ const fn_no_comma = fn(i32, i32)void; const fn_trailing_comma = fn(i32, i32,)void; fn fn_calls() void { - fn add(x: i32, y: i32,) i32 { x + y }; + fn add(x: i32, y: i32,) i32.{ x + y }; _ = add(1, 2); _ = add(1, 2,); } |
