From aaa51fc734dde35ab8109bad04e478cdf4fff950 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 17 Sep 2024 15:17:13 -0400 Subject: Perform topological ordering when compiling typedefs so users don't need to think about ordering their definitions. --- typecheck.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'typecheck.c') diff --git a/typecheck.c b/typecheck.c index eefd92b5..ab64bbf3 100644 --- a/typecheck.c +++ b/typecheck.c @@ -303,8 +303,8 @@ void bind_statement(env_t *env, ast_t *statement) code_err(field_ast->type, "This is a recursive struct that would be infinitely large. Maybe you meant to use an optional '@%T?' pointer instead?", type); else code_err(field_ast->type, "I'm still in the process of defining the fields of %T, so I don't know how to use it as a member." - "\nTry using a @%T pointer for this field or moving the definition of %T before %T in the file.", - field_t, field_t, field_t, type); + "\nTry using a @%T pointer for this field.", + field_t, field_t); } fields = new(arg_t, .name=field_ast->name, .type=field_t, .default_val=field_ast->value, .next=fields); } @@ -335,8 +335,8 @@ void bind_statement(env_t *env, ast_t *statement) code_err(field_ast->type, "This is a recursive enum that would be infinitely large. Maybe you meant to use an optional '@%T?' pointer instead?", type); else code_err(field_ast->type, "I'm still in the process of defining the fields of %T, so I don't know how to use it as a member." - "\nTry using a @%T pointer for this field or moving the definition of %T before %T in the file.", - field_t, field_t, field_t, type); + "\nTry using a @%T pointer for this field.", + field_t, field_t); } fields = new(arg_t, .name=field_ast->name, .type=field_t, .default_val=field_ast->value, .next=fields); } -- cgit v1.2.3