zig/test/cases/compile_errors/reify_struct.zig
Ali Cheraghi dec1163fbb
all: replace all @Type usages
Co-authored-by: Matthew Lugg <mlugg@mlugg.co.uk>
2025-11-22 22:42:38 +00:00

16 lines
510 B
Zig

comptime {
@Struct(.auto, null, &.{"foo"}, &.{u32}, &.{.{ .@"comptime" = true }});
}
comptime {
@Struct(.@"extern", null, &.{"foo"}, &.{u32}, &.{.{ .@"comptime" = true, .default_value_ptr = &@as(u32, 10) }});
}
comptime {
@Struct(.@"packed", null, &.{"foo"}, &.{u32}, &.{.{ .@"align" = 4 }});
}
// error
//
// :2:46: error: comptime field without default initialization value
// :5:51: error: extern struct fields cannot be marked comptime
// :8:51: error: packed struct fields cannot be aligned