From a380b803ac8b4eefcde4d3d552cdcbc8010aa798 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 21 Apr 2016 09:47:41 -0700 Subject: ability to use a struct with no fields --- test/self_hosted.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') 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 } +} -- cgit v1.2.3