Repository navigation
fix(compiler): unify empty-array catch arms with try-block element type - #4210
antoniosarosi wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
⏭️ Performance benchmarks were skippedPerf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to To run them on this PR, do any of the following, then push a commit (or re-run CI):
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughCatch-arm inference now treats the try-block type as a soft contextual expectation, recursively adopting compatible container literal types while preserving unions for incompatible fallbacks. New Phase 8 tests cover arrays, maps, nested containers, and downstream resolution. ChangesCatch-arm inference
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CatchAll
participant CatchArmInference
participant ContextualUpdates
participant TIR
CatchAll->>CatchArmInference: infer fallback expression
CatchArmInference->>ContextualUpdates: compare with try-block base type
ContextualUpdates-->>CatchArmInference: apply recursive updates or roll back
CatchArmInference->>TIR: synthesize adopted type or union
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Binary size checks passed✅ 7 passed
Generated by |
|
Closing — this was an orchestration experiment run; not landing. |
Fixes B-616
Use the try-block type as a soft expectation for synthesized catch arms so compatible empty and nested container literals adopt it without rejecting genuinely different union members.
Tests cover for-in, direct and let-bound use, nested and non-empty array literals, empty maps, and heterogeneous catch results.
Summary by CodeRabbit
Bug Fixes
catchexpressions, including empty and nested arrays, maps, and object literals.Tests