Skip to content

Conversation

jakebailey
Copy link
Member

Noticed this when looking at #1600. In Strada, this is unconditional if the type node isn't being reused.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the location of the addUndefinedForParameter check in the type serialization logic. Previously, the check was incorrectly nested inside a conditional block, causing it to be skipped in certain scenarios where type nodes weren't being reused.

Key Changes

  • Moved the addUndefinedForParameter logic outside of a conditional block to ensure it always executes when appropriate
  • Fixed the closing brace placement to match the corrected logic flow

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

File Description
internal/checker/nodebuilderimpl.go Moved addUndefinedForParameter check outside conditional block and fixed brace placement
Multiple baseline files Updated test baselines reflecting corrected type inference for parameters with `

@jakebailey jakebailey added this pull request to the merge queue Aug 19, 2025
Merged via the queue into main with commit 2c91932 Aug 19, 2025
22 checks passed
@jakebailey jakebailey deleted the jabaile/fix-add-undefined branch August 19, 2025 18:49
zshannon pushed a commit to zshannon/typescript-go that referenced this pull request Oct 6, 2025
zshannon pushed a commit to zshannon/typescript-go that referenced this pull request Oct 6, 2025
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.

2 participants