diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index f7f926542b..e197d17852 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -4953,6 +4953,11 @@ fn (mut c Checker) index_expr(mut node ast.IndexExpr) ast.Type { typ_sym = unsafe { unwrapped_sym } } } + .string { + if node.is_gated && c.mod != 'strings' { + c.table.used_features.range_index = true + } + } else {} } if !c.is_builtin_mod && c.mod !in ['strings', 'math.bits'] {