Skip to content

Commit 8a39132

Browse files
authored
markused: fix for gated index range on string (fix #24187) (#24200)
1 parent 5e69315 commit 8a39132

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎vlib/v/checker/checker.v‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4953,6 +4953,11 @@ fn (mut c Checker) index_expr(mut node ast.IndexExpr) ast.Type {
49534953
typ_sym = unsafe { unwrapped_sym }
49544954
}
49554955
}
4956+
.string {
4957+
if node.is_gated && c.mod != 'strings' {
4958+
c.table.used_features.range_index = true
4959+
}
4960+
}
49564961
else {}
49574962
}
49584963
if !c.is_builtin_mod && c.mod !in ['strings', 'math.bits'] {

0 commit comments

Comments
 (0)