Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores more fine-grained --isolatedDeclarations (ID) error locations by tracking the specific AST nodes that force pseudochecker inference fallback (e.g. shorthand props, spreads, non-literal computed names) and reporting errors on those nodes while still emitting types from the real checker when necessary.
Changes:
- Extend
PseudoTypeInferredto carryErrorNodesand have pseudochecker collect them for object/array literals that can’t be fully represented. - Update
NodeBuilderImplto (a) report inference fallback at the recorded error nodes and (b) fall back to the checker’s type serialization forPseudoTypeInferredin reuse paths to avoid wrong output in instantiated contexts. - Update submodule baseline outputs to reflect the restored error locations/type printing.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/pseudochecker/type.go | Adds ErrorNodes to PseudoTypeInferred and constructor for inferred-with-errors. |
| internal/pseudochecker/lookup.go | Collects and propagates error-node slices for object/array literal fallback decisions. |
| internal/checker/pseudotypenodebuilder.go | Reports fallback at specific nodes and introduces checker-type fallback serialization for inferred pseudotypes. |
| internal/checker/nodebuilderimpl.go | Routes reuse serialization through the new checker-fallback helper. |
| testdata/baselines/reference/submodule/** | Baseline updates for error locations and emitted types. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a little hokey; I tried to do a method where a reporter was passed down but could not get it to work how I wanted.
This is an alternative; inferred types have a list of error nodes, and then things are tweaked so we can bubble info back out again, reporting errors but not interfering with other inferences.
This does seem to have the desired effect, and unblocks adding a the ID quickfix which wants more specific locations.