mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
16 lines
223 B
Zig
16 lines
223 B
Zig
const Foo = struct {
|
|
a: i32 = 1234,
|
|
b: i32,
|
|
};
|
|
|
|
test "default struct initialization fields" {
|
|
const x: Foo = .{
|
|
.b = 5,
|
|
};
|
|
if (x.a + x.b != 1239) {
|
|
comptime unreachable;
|
|
}
|
|
}
|
|
|
|
// test
|