aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-04 01:12:37 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-04 01:12:37 -0500
commitb69d14b89492919dc5c1669d2c569ee3baf1bbb0 (patch)
tree4244c09bb428709f0e1f6e53f25e9125c4ae3cd4 /typecheck.c
parent81a180eda0efda86256b4aa2f8f6caecac3a9151 (diff)
Add some missing functionality for Bytes
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/typecheck.c b/typecheck.c
index e5255959..44068f5a 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -702,7 +702,7 @@ type_t *get_type(env_t *env, ast_t *ast)
if (value_t->tag == ArrayType) {
if (!indexing->index) return indexed_t;
type_t *index_t = get_type(env, indexing->index);
- if (index_t->tag == IntType || index_t->tag == BigIntType)
+ if (index_t->tag == IntType || index_t->tag == BigIntType || index_t->tag == ByteType)
return Match(value_t, ArrayType)->item_type;
code_err(indexing->index, "I only know how to index lists using integers, not %T", index_t);
} else if (value_t->tag == TableType) {
@@ -720,7 +720,7 @@ type_t *get_type(env_t *env, ast_t *ast)
if (fn_type_t->tag == TypeInfoType) {
type_t *t = Match(fn_type_t, TypeInfoType)->type;
if (t->tag == StructType || t->tag == IntType || t->tag == BigIntType || t->tag == NumType
- || t->tag == TextType || t->tag == CStringType || t->tag == DateTimeType)
+ || t->tag == ByteType || t->tag == TextType || t->tag == CStringType || t->tag == DateTimeType)
return t; // Constructor
code_err(call->fn, "This is not a type that has a constructor");
}