mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix body arguments: (@foo(;int x) and mismatch on canonical types)
This commit is contained in:
@@ -719,7 +719,7 @@ static Expr *parse_call_expr(ParseContext *c, Expr *left)
|
||||
advance_and_verify(c, TOKEN_LPAREN);
|
||||
bool splat = false;
|
||||
Decl **body_args = NULL;
|
||||
if (!tok_is(c, TOKEN_RPAREN))
|
||||
if (!tok_is(c, TOKEN_RPAREN) && !tok_is(c, TOKEN_EOS))
|
||||
{
|
||||
// Pick a modest guess.
|
||||
params = VECNEW(Expr*, 4);
|
||||
|
||||
@@ -1676,10 +1676,10 @@ bool sema_expr_analyse_macro_call(SemaContext *context, Expr *call_expr, Expr *s
|
||||
if (body_param->var.type_info)
|
||||
{
|
||||
Type *declare_type = body_param->var.type_info->type->canonical;
|
||||
if (declare_type != body_arg->type)
|
||||
if (declare_type != body_arg->type->canonical)
|
||||
{
|
||||
SEMA_ERROR(body_arg->var.type_info, "This parameter should be '%s' but was '%s'",
|
||||
type_to_error_string(declare_type),
|
||||
SEMA_ERROR(body_arg->var.type_info, "This parameter should be %s but was %s",
|
||||
type_quoted_error_string(declare_type),
|
||||
type_quoted_error_string(body_arg->type));
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user