Skip to content

Conversation

ahejlsberg
Copy link
Member

Fixes #1790.

@Copilot Copilot AI review requested due to automatic review settings October 3, 2025 15:34
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

Fixes an issue in findMatchingDiscriminantType to improve type checking accuracy by restructuring control flow to ensure discriminant property matching only occurs when discriminant properties are actually found.

  • Restructured the discriminant property matching logic to use early returns
  • Added proper condition checking before attempting type discrimination

Reviewed Changes

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

File Description
internal/checker/relater.go Refactored findMatchingDiscriminantType to check for discriminant properties before attempting discrimination
Multiple baseline files Removed error output differences, indicating improved convergence with TypeScript behavior

@ahejlsberg ahejlsberg requested a review from jakebailey October 3, 2025 15:36
Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

Nice

@jakebailey
Copy link
Member

Ah, one broken baseline in CI

@ahejlsberg ahejlsberg enabled auto-merge October 3, 2025 17:23
@ahejlsberg ahejlsberg added this pull request to the merge queue Oct 3, 2025
Merged via the queue into main with commit cc551fb Oct 3, 2025
22 checks passed
@ahejlsberg ahejlsberg deleted the fix-1790 branch October 3, 2025 17:42
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.

Different error message when object is assigned to a union that contains undefined
2 participants