diff --git a/lib/rivet/src/ast/TypeInfo.ri b/lib/rivet/src/ast/TypeInfo.ri index 9cbc1d282..7a2f1c7d5 100644 --- a/lib/rivet/src/ast/TypeInfo.ri +++ b/lib/rivet/src/ast/TypeInfo.ri @@ -140,7 +140,7 @@ pub enum TypeInfo < traits.Stringable { } #[inline] - pub func is_mut_arr_or_vec(self) -> bool { + pub func is_mut_arr_or_dyn_array(self) -> bool { return match self is { .Array(arr) -> arr.is_mut, .DynArray(vec) -> vec.is_mut, diff --git a/lib/rivet/src/checker/exprs.ri b/lib/rivet/src/checker/exprs.ri index b7fcdb86d..b30a7bd9f 100644 --- a/lib/rivet/src/checker/exprs.ri +++ b/lib/rivet/src/checker/exprs.ri @@ -263,7 +263,7 @@ extend Checker { if value_sym.info is .Array(array_info) { size = array_info.size; } - is_mut = value_sym.info.is_mut_arr_or_vec(); + is_mut = value_sym.info.is_mut_arr_or_dyn_array(); } else if !self.expected_type.is_void() { has_expected_type = true; value_type = self.expected_type; @@ -416,7 +416,7 @@ extend Checker { .Array, .DynArray -> { elem_type := left_sym.info.elem_type()?; if index.index is .Range { - is_mut := left_sym.info.is_mut_arr_or_vec(); + is_mut := left_sym.info.is_mut_arr_or_dyn_array(); if left_sym.info is .DynArray { index.left_type } else { diff --git a/lib/rivet/src/checker/mod.ri b/lib/rivet/src/checker/mod.ri index 4af05b078..2c2f37d60 100644 --- a/lib/rivet/src/checker/mod.ri +++ b/lib/rivet/src/checker/mod.ri @@ -339,7 +339,7 @@ pub struct Checker { return; } expr_sym := index.left_type.symbol()?; - if !expr_sym.info.is_mut_arr_or_vec() { + if !expr_sym.info.is_mut_arr_or_dyn_array() { report.error( "cannot modify elements of an immutable {}".fmt(expr_sym.info), index.pos diff --git a/lib/rivet/src/checker/stmts.ri b/lib/rivet/src/checker/stmts.ri index 54cb402e1..0b44571bf 100644 --- a/lib/rivet/src/checker/stmts.ri +++ b/lib/rivet/src/checker/stmts.ri @@ -74,7 +74,7 @@ extend Checker { elem_sym := elem_type.symbol()?; if for_stmt.values.len == 1 { value0 := for_stmt.values[0]; - if value0.is_mut and !iterable_sym.info.is_mut_arr_or_vec() { + if value0.is_mut and !iterable_sym.info.is_mut_arr_or_dyn_array() { report.error( "cannot modify immutable {}".fmt(iterable_sym.info), for_stmt.iterable.position() diff --git a/rivetc/src/codegen/__init__.py b/rivetc/src/codegen/__init__.py index 10d6f99d3..3dbe78bb3 100644 --- a/rivetc/src/codegen/__init__.py +++ b/rivetc/src/codegen/__init__.py @@ -103,7 +103,7 @@ def gen_source_files(self, source_files): ir.Selector(ir.UINT64_T, testRunner, ir.Name("skip_tests")), ir.IntLit(ir.UINT64_T, "0") ) - tests_vec = ir.Selector( + tests_dyn_array = ir.Selector( ir.DYN_ARRAY_T.ptr(True), testRunner, ir.Name("tests") ) test_t = ir.TEST_T.ptr()