nushell / nushell/new-nu-parser
Different type IDs can point at the same type
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 34
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
As pointed out in https://github.com/nushell/new-nu-parser/pull/50, typecheck_match() looks only at type IDs without actually checking the underlying type. This means that two identical types, such as:
let x: oneof<list<int>, list<string>> = []
let y: oneof<list<int>, list<string>> = []
would have different IDs and result in type mismatch.
Two possible solutions:
- Change
typecheck_match()to actually check the types properly - When creating a type, first check whether it's been created already and reuse its ID if so. This would ensure that different type IDs would point at different types.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by tracing typecheck_match() and the type-creation path referenced in the issue. Reproduce the two oneof examples, then determine whether matching compares underlying types or reuses IDs; done means identical types no longer produce a type mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100