diff options
| author | Joakim Hentula <joakim.hentula@gmail.com> | 2022-03-02 16:44:33 +0000 |
|---|---|---|
| committer | Joakim Hentula <joakim.hentula@gmail.com> | 2022-03-02 16:44:33 +0000 |
| commit | a5dde78f0882cc6db0b329f356dc7345d47798ca (patch) | |
| tree | 1f2ac29dc966e5d469c34fe530679b5cc85718c3 /src/check_builtin.cpp | |
| parent | fd415f0b45ad7e07a72fc3938c9a22387f3556dc (diff) | |
Add relative slice to type checks for built in len
Diffstat (limited to 'src/check_builtin.cpp')
| -rw-r--r-- | src/check_builtin.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index aeeeb9e4d..365d3434f 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -952,7 +952,7 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32 mode = Addressing_Constant; value = exact_value_i64(at->EnumeratedArray.count); type = t_untyped_integer; - } else if (is_type_slice(op_type) && id == BuiltinProc_len) { + } else if ((is_type_slice(op_type) || is_type_relative_slice(op_type)) && id == BuiltinProc_len) { mode = Addressing_Value; } else if (is_type_dynamic_array(op_type)) { mode = Addressing_Value; |