mirror of
https://github.com/ziglang/zig.git
synced 2024-12-13 23:00:57 +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
|