Skip to content
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

checker: allow casted integeral types in match ranges #19572

Merged

Conversation

Delta456
Copy link
Member

@Delta456 Delta456 commented Oct 15, 2023

Closes #19571

🤖 Generated by Copilot at 5353936

This pull request adds support for matching integer literals with different types in match conditions, and improves the error messages for invalid range expressions. It also adds tests for these features in vlib/v/checker/tests and vlib/v/tests.

🤖 Generated by Copilot at 5353936

  • Add special case for cast expressions in match conditions (link)
  • Add test function for matching cast expressions in match_const_range_test.v (link)
    • Use constants defined in the same file (link)
  • Add test files for checking error messages when match condition type and range type do not match (link, link)
  • Add test files for checking error messages when low and high parts of range expression have different types (link, link)

@Delta456 Delta456 force-pushed the match_allow_cast_expr_integeral_types branch from 5353936 to 3a22ad0 Compare October 15, 2023 13:38
@medvednikov
Copy link
Member

Nice and clean. Good job.

@medvednikov medvednikov merged commit 44045c6 into vlang:master Oct 15, 2023
47 of 51 checks passed
@Delta456 Delta456 deleted the match_allow_cast_expr_integeral_types branch October 16, 2023 11:24
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.

Typed constants are not constants?
2 participants