Refactor `unwrap()` and type signatures in `src/codegen/generator.rs` to use `Result`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 14
- Forks
- 2
- Avg merge
- 12h 42m
- Merged PRs (30d)
- 61
Description
Description
During the codegen panic cleanup pass, over 340 unwrap() calls were safely removed from src/codegen/lower/. However, some heavy .unwrap() usages remain in src/codegen/generator.rs, primarily inside coerce_type and lower_type.
Changing these functions to return Result<..., LowerError> currently cascades into over 100+ type mismatch errors across the compiler because they are called deep within type inference and static type instantiation where Result propagation cannot easily be bubbled up without a larger architectural shift in the compiler driver.
Action Items
- Refactor
coerce_typeandlower_typeingenerator.rsto safely returnResult. - Propagate these errors correctly through callers that currently expect a raw
Type. - Eliminate the remaining compiler panics during MLIR AST lowering in
generator.rs.
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 in src/codegen/generator.rs by reading coerce_type and lower_type, then trace their callers through type inference and static type instantiation. The issue notes that Result propagation currently causes more than 100 type mismatches, so map that call chain before changing signatures. Done means these functions propagate LowerError and compiler panics during MLIR AST lowering are eliminated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100