markused: fix for gated index range on string (fix #24187) (#24200)

This commit is contained in:
Felipe Pena 2025-04-13 13:22:03 -03:00 committed by GitHub
parent 5e69315fc2
commit 8a39132b6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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'] {