Skip to content

Conversation

@ahejlsberg
Copy link
Member

Fixes #1731.

Copy link
Contributor

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 adds test coverage for import alias resolution errors when referencing declarations exported using export type, and simplifies related checker code by removing an unused helper function.

  • Adds a new compiler test case demonstrating that import aliases cannot reference type-only exports
  • Removes the unused getNameFromImportDeclaration helper function
  • Simplifies the error reporting code to directly call .Name().Text() on the type-only declaration node

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
testdata/tests/cases/compiler/importAliasTypeOnlyExport.ts New test case for import alias referencing a type-only export
testdata/baselines/reference/compiler/importAliasTypeOnlyExport.types Baseline for type information output
testdata/baselines/reference/compiler/importAliasTypeOnlyExport.symbols Baseline for symbol information output
testdata/baselines/reference/compiler/importAliasTypeOnlyExport.errors.txt Expected error diagnostic for the test case
internal/checker/utilities.go Removes unused getNameFromImportDeclaration helper function
internal/checker/checker.go Simplifies error reporting by directly calling .Name().Text()

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.

Test does reproduce the crash, thanks!

@ahejlsberg ahejlsberg enabled auto-merge November 6, 2025 00:25
@ahejlsberg ahejlsberg added this pull request to the merge queue Nov 6, 2025
Merged via the queue into main with commit a5ad4f1 Nov 6, 2025
29 checks passed
@ahejlsberg ahejlsberg deleted the fix-1731 branch November 6, 2025 00:46
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.

Segmentation fault

3 participants