mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix missing check when macro method incorrectly has a raw vararg argument.
This commit is contained in:
@@ -2170,11 +2170,15 @@ static bool sema_analyse_macro_method(SemaContext *context, Decl *decl)
|
||||
}
|
||||
if (!vec_size(decl->func_decl.signature.params))
|
||||
{
|
||||
SEMA_ERROR(decl, "Expected at least one parameter - of type %s.", type_to_error_string(parent_type));
|
||||
SEMA_ERROR(decl, "Expected at least one parameter - of type '%s'.", type_to_error_string(parent_type));
|
||||
return false;
|
||||
}
|
||||
Decl *first_param = decl->func_decl.signature.params[0];
|
||||
|
||||
if (!first_param)
|
||||
{
|
||||
SEMA_ERROR(decl, "The first parameter to this method must be of type '%s'.", type_to_error_string(parent_type));
|
||||
return false;
|
||||
}
|
||||
if (!sema_is_valid_method_param(context, first_param, parent_type->canonical)) return false;
|
||||
|
||||
if (first_param->var.kind != VARDECL_PARAM_REF && first_param->var.kind != VARDECL_PARAM)
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define COMPILER_VERSION "0.3.103"
|
||||
#define COMPILER_VERSION "0.3.104"
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
struct Foo { int y; }
|
||||
|
||||
macro Foo.text(...) = f.y; // #error: The first parameter to this method must
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
struct Foo { int y; }
|
||||
|
||||
macro Foo.text(...) = f.y; // #error: The first parameter to this method must
|
||||
Reference in New Issue
Block a user