ability to use a struct with no fields

This commit is contained in:
Andrew Kelley
2016-04-21 09:47:41 -07:00
parent ae600d2f7f
commit a380b803ac
3 changed files with 15 additions and 2 deletions

View File

@@ -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 }
}