aboutsummaryrefslogtreecommitdiff
path: root/test/self_hosted.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-04-21 09:47:41 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-04-21 09:47:41 -0700
commita380b803ac8b4eefcde4d3d552cdcbc8010aa798 (patch)
treede6309db31e1614467295bfd82c3bc27928bd27b /test/self_hosted.zig
parentae600d2f7f89989c297c036f189b7bedfde910af (diff)
downloadzig-a380b803ac8b4eefcde4d3d552cdcbc8010aa798.tar.gz
zig-a380b803ac8b4eefcde4d3d552cdcbc8010aa798.zip
ability to use a struct with no fields
Diffstat (limited to 'test/self_hosted.zig')
-rw-r--r--test/self_hosted.zig10
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 }
+}