diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-04-21 09:47:41 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-04-21 09:47:41 -0700 |
| commit | a380b803ac8b4eefcde4d3d552cdcbc8010aa798 (patch) | |
| tree | de6309db31e1614467295bfd82c3bc27928bd27b /test | |
| parent | ae600d2f7f89989c297c036f189b7bedfde910af (diff) | |
| download | zig-a380b803ac8b4eefcde4d3d552cdcbc8010aa798.tar.gz zig-a380b803ac8b4eefcde4d3d552cdcbc8010aa798.zip | |
ability to use a struct with no fields
Diffstat (limited to 'test')
| -rw-r--r-- | test/self_hosted.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/self_hosted.zig b/test/self_hosted.zig index e621dbf3f2..3bf19b61f5 100644 --- a/test/self_hosted.zig +++ b/test/self_hosted.zig @@ -1285,3 +1285,13 @@ fn mangle_string(s: []u8) { *c += 1; } } + +#attribute("test") +fn empty_struct_method_call() { + const es = EmptyStruct{}; + assert(es.method() == 1234); +} +struct EmptyStruct { + #static_eval_enable(false) + fn method(es: EmptyStruct) -> i32 { 1234 } +} |
