aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 82ac6c677..d8cad2ce1 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -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;