mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-01 10:52:19 +00:00
Disallow anonymous structs with procedures as default values
This commit is contained in:
@@ -3301,6 +3301,11 @@ bool check_type_internal(Checker *c, AstNode *e, Type **type, Type *named_type)
|
||||
check_struct_type(c, *type, e, nullptr, named_type);
|
||||
check_close_scope(c);
|
||||
(*type)->Struct.node = e;
|
||||
|
||||
if (named_type == nullptr && (*type)->Struct.has_proc_default_values) {
|
||||
error(e, "Anonymous structs cannot have procedures as default values");
|
||||
}
|
||||
|
||||
return true;
|
||||
case_end;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user