mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Allow var in lambdas in macros. Allow ad hoc generic declaration in lambdas and type definitions. Fix deprecation flag.
This commit is contained in:
@@ -3788,7 +3788,7 @@ bool sema_analyse_var_decl(SemaContext *context, Decl *decl, bool local)
|
||||
SEMA_ERROR(decl, "Constants need to have an initial value.");
|
||||
return decl_poison(decl);
|
||||
}
|
||||
if (kind == VARDECL_LOCAL && !context->current_macro)
|
||||
if (kind == VARDECL_LOCAL && !context_is_macro(context))
|
||||
{
|
||||
SEMA_ERROR(decl, "Defining a variable using 'var %s = ...' is only allowed inside a macro.", decl->name);
|
||||
return decl_poison(decl);
|
||||
|
||||
Reference in New Issue
Block a user