diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-04-19 18:52:09 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-04-19 18:52:09 -0700 |
| commit | 36c6acfc76eeeed1498b5cc9ecb3137214e69bbf (patch) | |
| tree | 40e2ffa30130a2ed1dd8f5674843237b108176f6 /test | |
| parent | 7a7f83033c3fee3e92046b76dd33b9f8ded4f0fd (diff) | |
| download | zig-36c6acfc76eeeed1498b5cc9ecb3137214e69bbf.tar.gz zig-36c6acfc76eeeed1498b5cc9ecb3137214e69bbf.zip | |
enum init uses container init syntax instead of fn call
See #5
Diffstat (limited to 'test')
| -rw-r--r-- | test/self_hosted.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/self_hosted.zig b/test/self_hosted.zig index 74fb23c464..dd487e7a71 100644 --- a/test/self_hosted.zig +++ b/test/self_hosted.zig @@ -353,8 +353,8 @@ fn maybe_type() { #attribute("test") fn enum_type() { - const foo1 = EnumTypeFoo.One(13); - const foo2 = EnumTypeFoo.Two(EnumType { .x = 1234, .y = 5678, }); + const foo1 = EnumTypeFoo.One {13}; + const foo2 = EnumTypeFoo.Two {EnumType { .x = 1234, .y = 5678, }}; const bar = EnumTypeBar.B; assert(bar == EnumTypeBar.B); @@ -449,7 +449,7 @@ fn should_be_not_equal(a: error, b: error) { #attribute("test") fn constant_enum_with_payload() { var empty = AnEnumWithPayload.Empty; - var full = AnEnumWithPayload.Full(13); + var full = AnEnumWithPayload.Full {13}; should_be_empty(empty); should_be_not_empty(full); } @@ -547,8 +547,8 @@ enum SwitchStatmentFoo { #attribute("test") fn switch_prong_with_var() { - switch_prong_with_var_fn(SwitchProngWithVarEnum.One(13)); - switch_prong_with_var_fn(SwitchProngWithVarEnum.Two(13.0)); + switch_prong_with_var_fn(SwitchProngWithVarEnum.One {13}); + switch_prong_with_var_fn(SwitchProngWithVarEnum.Two {13.0}); switch_prong_with_var_fn(SwitchProngWithVarEnum.Meh); } enum SwitchProngWithVarEnum { @@ -1221,8 +1221,8 @@ struct Test3Point { x: i32, y: i32, } -const test3_foo = Test3Foo.Three(Test3Point {.x = 3, .y = 4}); -const test3_bar = Test3Foo.Two(13); +const test3_foo = Test3Foo.Three{Test3Point {.x = 3, .y = 4}}; +const test3_bar = Test3Foo.Two{13}; #static_eval_enable(false) fn test3_1(f: Test3Foo) { switch (f) { |
