mirror of
https://github.com/ziglang/zig.git
synced 2024-12-16 16:20:14 +00:00
astgen: error on struct field with no type
This commit is contained in:
parent
84fe5d4681
commit
960932a4bf
@ -3558,6 +3558,10 @@ fn structDeclInner(
|
||||
const field_name = try astgen.identAsString(member.ast.name_token);
|
||||
fields_data.appendAssumeCapacity(field_name);
|
||||
|
||||
if (member.ast.type_expr == 0) {
|
||||
return astgen.failTok(member.ast.name_token, "struct field missing type", .{});
|
||||
}
|
||||
|
||||
const field_type: Zir.Inst.Ref = if (node_tags[member.ast.type_expr] == .@"anytype")
|
||||
.none
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user