Add unit tests for nested generic type grammar
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 46
Description
## Why
`split_top_level_generic_args` and `parse_type` in `front/parser/src/parser/types.rs` handle nested generic, pointer, array, and qualified type spellings. They have no focused unit-test suite even though imports and generic monomorphization depend on them.
## Scope
- Add positive tests for nested `ptr`, `array`, qualified names, and multiple generic arguments.
- Add negative tests for empty arguments, unbalanced chevrons, invalid array lengths, extra commas, and trailing garbage.
- Assert the exact `TokenType` or `WaveType` representation.
- Do not redesign type syntax.
## Likely files
- `front/parser/src/parser/types.rs`
- A new parser test module
## Completion criteria
- [ ] Nested and qualified types are covered.
- [ ] Malformed nesting and separators return `None` without panic.
- [ ] Existing primitive and custom type behavior is preserved.
- [ ] `cargo test -p parser --locked` passes.
Contributor guide
Research direction
Read split_top_level_generic_args and parse_type in front/parser/src/parser/types.rs, then inspect the surrounding parser tests or create the proposed parser test module. Add positive and malformed nested-type cases asserting exact TokenType or WaveType results, including None without panics. Run cargo test -p parser --locked and confirm primitive and custom type behavior remains passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100