Skip to content

markused: fix for gated index range on string #24200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2025

Conversation

felipensp
Copy link
Member

Fix #24187

@@ -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' {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why make an exception for the strings module?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still do not see the reason for making it a special case, but it does solve the issue, and I do not see it as a big problem (just a bit slower), if it behaves a bit differently for strings.

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work, only a test is missing.

@spytheman spytheman merged commit 8a39132 into vlang:master Apr 13, 2025
77 of 80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_trimmed_lines() results in C error
2 participants