aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-07-20 19:55:54 +0100
committerGinger Bill <bill@gingerbill.org>2017-07-20 19:55:54 +0100
commit401a5955a4ed1746e96f29db8e521cb4831a863d (patch)
tree83b8c3fcfcb399751d69367af124fe72c75bfb4b /src
parent9a3b4167bb8495f9422ffa5cb242198fed3a315b (diff)
Fix minor check on vector types
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index cd467cce1..18cd3026d 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -3017,11 +3017,7 @@ bool check_type_internal(Checker *c, AstNode *e, Type **type, Type *named_type)
Type *elem = check_type(c, vt->elem);
Type *be = base_type(elem);
i64 count = check_array_or_map_count(c, vt->count, false);
- if (!c->context.allow_polymorphic_types && is_type_polymorphic(base_type(elem))) {
- gbString str = type_to_string(elem);
- error(vt->elem, "Invalid use of a polymorphic type `%s` as an dynamic array element type", str);
- gb_string_free(str);
- } else if (is_type_vector(be) || (!is_type_boolean(be) && !is_type_numeric(be) && !is_type_polymorphic(base_type(elem)))) {
+ if (is_type_vector(be) || (!is_type_boolean(be) && !is_type_numeric(be) && be->kind != Type_Generic)) {
gbString err_str = type_to_string(elem);
error(vt->elem, "Vector element type must be numerical or a boolean, got `%s`", err_str);
gb_string_free(err_str);