Make #simd an opaque type

This commit is contained in:
gingerBill
2022-05-25 17:26:18 +01:00
parent d8e77cd738
commit b032d5af87
5 changed files with 34 additions and 24 deletions

View File

@@ -313,13 +313,19 @@ void check_type_decl(CheckerContext *ctx, Entity *e, Ast *init_expr, Type *def)
}
named->Named.base = base;
if (is_distinct && is_type_typeid(e->type)) {
error(init_expr, "'distinct' cannot be applied to 'typeid'");
is_distinct = false;
}
if (is_distinct && is_type_any(e->type)) {
error(init_expr, "'distinct' cannot be applied to 'any'");
is_distinct = false;
if (is_distinct) {
if (is_type_typeid(e->type)) {
error(init_expr, "'distinct' cannot be applied to 'typeid'");
is_distinct = false;
} else if (is_type_any(e->type)) {
error(init_expr, "'distinct' cannot be applied to 'any'");
is_distinct = false;
} else if (is_type_simd_vector(e->type)) {
gbString str = type_to_string(e->type);
error(init_expr, "'distinct' cannot be applied to '%s'", str);
gb_string_free(str);
is_distinct = false;
}
}
if (!is_distinct) {
e->type = bt;