Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 10, 2025

Port TypeScript PR #60195: Assume that type node annotations resolving to error types can be reused

Plan:

  • Analyze the original TypeScript PR changes
  • Locate the equivalent Go code in internal/checker/nodebuilderimpl.go
  • Identify the exact function and location for the change
  • Add error type check in tryReuseExistingNonParameterTypeNode function
  • Build and test the change
  • Run baseline tests and accept changes
  • Validate the fix works correctly

Change Details:

The original TypeScript PR adds a check in the type node reuse logic to allow reusing type nodes that resolve to error types. This prevents cascading errors in isolatedDeclarations when there are already type errors in the source.

In the Go port, this needs to be added in internal/checker/nodebuilderimpl.go in the tryReuseExistingNonParameterTypeNode function, right after the annotationType = b.getTypeFromTypeNode(existing, true) call.

Fixes #1118.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@weswigham
Copy link
Member

In the go port, this codepath is untested and unused at present, along with all the nodebuilder node-reuse logic, so can't be verified as doing that the original PR intended until that's in.

@weswigham weswigham closed this Jun 10, 2025
@jakebailey jakebailey deleted the copilot/fix-1118-2 branch June 24, 2025 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port TypeScript PR #60195: Assume that type node annotations resolving to error types can be reused

3 participants