refactor(inference): add structural type mapping - #11004
Conversation
|
✅ Organic activityNo automation signals detected in the analyzed events. This is an automated analysis by AgentScan |
ab00d23 to
b2ab727
Compare
0eed23e to
de8c2af
Compare
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThe PR adds bounded slot-based Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/biome_js_type_info/src/interned_types.rs (1)
671-675: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueTidy up the duplicated region markers.
Lines 671–673 open and immediately close an empty
//#regionStructural construction, and line 675 opens a second region with the same label. Looks like a copy/paste leftover — dropping the empty block keeps the section headers meaningful.🧹 Suggested tidy-up
- // `#region` Structural construction - - // `#endregion` - // `#region` Structural constructionAs per coding guidelines: "Write comments only when they convey information not recoverable from code".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/biome_js_type_info/src/interned_types.rs` around lines 671 - 675, Remove the empty duplicated `// `#region` Structural construction` block in `interned_types.rs`, keeping only the subsequent meaningful region marker and its contents.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/biome_js_type_info/src/interned_types.rs`:
- Around line 671-675: Remove the empty duplicated `// `#region` Structural
construction` block in `interned_types.rs`, keeping only the subsequent
meaningful region marker and its contents.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1b124294-ee72-4f21-9c70-31e3e5a1e783
📒 Files selected for processing (7)
crates/biome_js_type_info/src/interned_types.rscrates/biome_js_type_info/src/lib.rscrates/biome_js_type_info/src/resolved.rscrates/biome_js_type_info/src/type_transform.rscrates/biome_module_graph/src/db/queries/type_inference.rscrates/biome_module_graph/src/db/type_inference/expressions.rscrates/biome_module_graph/src/db/type_inference/lookup.rs
Merging this PR will degrade performance by 17.24%
Performance Changes
Comparing Footnotes
|

Summary
This PR adds some plumbing to substitute generics inside a graph of types. Generics are called "slots".
There's also some plumbing for:
Both work using a DFS iterator.
The new implementation:
TypeDataSlotsand rebuilds their original parent throughTypeDataSlotRebuilder.TypeDataSlotReplacementsto validate replacement counts and ensure every replacement is consumed.TypeDataTransformerwith a shared step limit and protection against recursive types.TypeSubstitution,TypeTransformResult, andTypeTransformError.TypeData::substitute_typeandTypeData::substitute_type_in_root_body.The generic transformation machinery remains private; callers use the semantic substitution APIs.
Test Plan
Added structural mapping unit tests and passed type-info tests and all-target clippy.
Docs
N/A