mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-31 10:22:08 +00:00
Make #simd an opaque type
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user