mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
Disallow aliasing of any and typeid
This commit is contained in:
@@ -321,7 +321,14 @@ gb_internal void check_type_decl(CheckerContext *ctx, Entity *e, Ast *init_expr,
|
|||||||
gb_string_free(str);
|
gb_string_free(str);
|
||||||
is_distinct = false;
|
is_distinct = false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (is_type_typeid(e->type)) {
|
||||||
|
error(init_expr, "'typeid' cannot be aliased");
|
||||||
|
} else if (is_type_any(e->type)) {
|
||||||
|
error(init_expr, "'any' cannot be aliased");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_distinct) {
|
if (!is_distinct) {
|
||||||
e->type = bt;
|
e->type = bt;
|
||||||
named->Named.base = bt;
|
named->Named.base = bt;
|
||||||
|
|||||||
Reference in New Issue
Block a user