Range patterns of strings are accepted
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start at the :todo case in tests/checker/patterns.txt on the test/checker-edges branch, then inspect the relevant type-checking code in the boltlang-hir-ty crate. Add the case so a string range pattern is rejected while ranges over supported ordered types remain valid; done when the checker test passes.
Written by the indexing model from the issue text.
Description
A range pattern of strings is accepted:
fn f(s: str) = match s { "a"..="z" => 1, _ => 2 };
Range patterns only make sense for types with an order that the compiler knows, like integers, floats and chars. A range of strings should be an error.
There's a :todo case in tests/checker/patterns.txt, on the branch test/checker-edges.
Crates: boltlang-hir-ty.
- Dominant language
- Rust
- Stars
- 54
- Forks
- 3
- Avg merge
- 7m
- Merged PRs (30d)
- 28
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boltlang/Bolt
-
bug priority:low rust
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
discussion documentation
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
bug scope:types
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
enhancement scope:diagnostics scope:syntax
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
bug scope:types
Difficulty 4/5 1-2 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
swc-project/swc-next#1165 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Alive24/shea-symphony#574 ·
-
bug tests Windows
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
dev-five-git/devup-ui#879 ·
Maintainers usually reply within 11 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
farion1231/cc-switch#9038 · 1 comment ·
Maintainers usually reply within 1 day