Remove derived from context; Fix parsing issue for typeid specializations in record parameters; Fix runtime printing of types

This commit is contained in:
gingerBill
2019-03-31 11:58:54 +01:00
parent 564e85ee29
commit 1354f53d02
4 changed files with 37 additions and 29 deletions
+3 -1
View File
@@ -1528,6 +1528,8 @@ parse_field_list :: proc(p: ^Parser, follow: token.Kind, allowed_flags: ast.Fiel
return ok;
}
is_signature := (allowed_flags & Field_Flags_Signature_Params) == Field_Flags_Signature_Params;
any_polymorphic_names := check_procedure_name_list(p, names);
set_flags = check_field_flag_prefixes(p, len(names), allowed_flags, set_flags);
@@ -1538,7 +1540,7 @@ parse_field_list :: proc(p: ^Parser, follow: token.Kind, allowed_flags: ast.Fiel
if p.curr_tok.kind != token.Eq {
type = parse_var_type(p, allowed_flags);
tt := ast.unparen_expr(type);
if !any_polymorphic_names {
if is_signature && !any_polymorphic_names {
if ti, ok := tt.derived.(ast.Typeid_Type); ok && ti.specialization != nil {
error(p, tt.pos, "specialization of typeid is not allowed without polymorphic names");
}