mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +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
|