mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Disallow attributes on alias declarations
This commit is contained in:
@@ -391,11 +391,21 @@ void check_const_decl(CheckerContext *ctx, Entity *e, Ast *type_expr, Ast *init,
|
|||||||
case Entity_Procedure:
|
case Entity_Procedure:
|
||||||
case Entity_LibraryName:
|
case Entity_LibraryName:
|
||||||
case Entity_ImportName:
|
case Entity_ImportName:
|
||||||
|
{
|
||||||
override_entity_in_scope(e, entity);
|
override_entity_in_scope(e, entity);
|
||||||
|
|
||||||
|
DeclInfo *decl = decl_info_of_entity(e);
|
||||||
|
if (decl != nullptr) {
|
||||||
|
if (decl->attributes.count > 0) {
|
||||||
|
error(decl->attributes[0], "Constant alias declarations cannot have attributes");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
check_init_constant(ctx, e, &operand);
|
check_init_constant(ctx, e, &operand);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user