simple enum support

This commit is contained in:
Andrew Kelley
2016-01-11 01:15:17 -07:00
parent 2061cd50c0
commit aaa62eda72
4 changed files with 95 additions and 18 deletions

View File

@@ -1031,6 +1031,19 @@ fn print_ok(val: #typeof(x)) -> #typeof(foo) {
}
const foo : i32 = 0;
)SOURCE", "OK\n");
add_simple_case("enum with void types", R"SOURCE(
use "std.zig";
enum Foo { A, B, C, D, }
pub fn main(argc: isize, argv: &&u8, env: &&u8) -> i32 {
const foo : Foo = Foo.B;
if (foo != Foo.B) {
print_str("BAD\n");
}
print_str("OK\n");
return 0;
}
)SOURCE", "OK\n");
}