You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
8000
[EXPERIMENT] Restack direct-object widening on current Biome main - #8
Exact-current-main execution carrier for the direct object-literal portion of Biome issue 11174.
Historical internal PR #4 reproduced the defect and passed its scoped candidate on the August 2 source base. Biome main has since advanced through the type-inference refactor in biomejs#11010.
This carrier targets exact public main 4a0bc5c46e6dbbefd17fa133ea426aa41f0a23f8 and exact local_inference.rs blob c8559d60bd1fb322ab4bf82394878362bad84a3b. The refactor preserved the object-member constructor but renamed the collector path, so the candidate is freshly materialized rather than replayed blindly.
Declared scope remains:
widen mutable direct boolean, number, and string object-property literals;
preserve as const literal inference;
cover nested direct object members;
leave generic-returned properties such as useRef<T>() unresolved.
The workflow formats the exact transformed source, checks biome_js_type_info, runs the focused analyzer suite, retains the exact three-file diff, and performs no canonical-upstream interaction.
Workflow 30976048058, job 92210131025, completed successfully at carrier head 42457ccdc163d2a2b71765f731d8e3e93ac7dad7 against exact canonical Biome main 4a0bc5c46e6dbbefd17fa133ea426aa41f0a23f8 and exact local_inference.rs blob c8559d60bd1fb322ab4bf82394878362bad84a3b.
Completed gates:
exact canonical source/blob identity;
fresh post-refactor source transformation;
exact three-file candidate fence, including generated valid fixture and snapshot;
Residual useRef source-owner probe — no execution triggered
Current canonical main is f1f72fefbe9a6a777d083277a792a4a498b88915, one dependency-maintenance commit beyond this carrier's exact green base. No JS type-inference source changed.
The remaining useRef cases are not owned by the direct-object constructor fixed here:
TypeData::from_any_js_expression records a call as a callee plus value arguments only. It does not retain explicit call type arguments.
flattened_function_call resolves the generic return shape, and infer_generic_arg substitutes the concrete argument reference directly wherever the return type uses the generic.
For useRef(false), that concrete reference is the literal type false, so the returned RefObject<T>.current remains false.
useRef<boolean>(false) currently follows the same path because the explicit <boolean> is discarded before flattening.
Bounded design split:
First lane: extend TypeofCallExpression to preserve explicit type arguments and prefer those substitutions over value-argument inference. This should fix the explicit useRef<boolean>(false) case without changing unannotated generic inference.
Second lane: for inferred generics, widen a literal only when that generic flows into a writable returned member. Do not globally widen generic arguments: identity(false) should remain the literal false, while useRef(false).current should be mutable boolean. This needs mutability/readonly-aware occurrence analysis in the returned object/interface shape.
Disposition of this PR remains unchanged: scoped accept for direct mutable object properties; incomplete for generic-returned mutable objects. No new branch, workflow, or upstream interaction was created by this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exact-current-main execution carrier for the direct object-literal portion of Biome issue 11174.
Historical internal PR #4 reproduced the defect and passed its scoped candidate on the August 2 source base. Biome main has since advanced through the type-inference refactor in biomejs#11010.
This carrier targets exact public main
4a0bc5c46e6dbbefd17fa133ea426aa41f0a23f8and exactlocal_inference.rsblobc8559d60bd1fb322ab4bf82394878362bad84a3b. The refactor preserved the object-member constructor but renamed the collector path, so the candidate is freshly materialized rather than replayed blindly.Declared scope remains:
as constliteral inference;useRef<T>()unresolved.The workflow formats the exact transformed source, checks
biome_js_type_info, runs the focused analyzer suite, retains the exact three-file diff, and performs no canonical-upstream interaction.