mirror of
https://github.com/ziglang/zig.git
synced 2026-01-10 01:15:14 +00:00
remove "unnecessary if statement" error this "depends on compile variable" code is too hard to validate, and has false negatives. not worth it right now. std.str removed, instead use std.mem. std.mem.eql and std.mem.sliceEql merged and do not require explicit type argument.
21 lines
325 B
Zig
21 lines
325 B
Zig
const assert = @import("std").debug.assert;
|
|
|
|
const Foo = struct {
|
|
a: void,
|
|
b: i32,
|
|
c: void,
|
|
};
|
|
|
|
fn compareVoidWithVoidCompileTimeKnown() {
|
|
@setFnTest(this);
|
|
|
|
comptime {
|
|
const foo = Foo {
|
|
.a = {},
|
|
.b = 1,
|
|
.c = {},
|
|
};
|
|
assert(foo.a == {});
|
|
}
|
|
}
|