Skip to content

Conversation

@ahejlsberg
Copy link
Member

Fixes #1940.

Copilot AI review requested due to automatic review settings October 23, 2025 21:47
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 fixes a crash in the invocationErrorRecovery function by correcting the lookup method used to retrieve symbol information. The fix changes from using valueSymbolLinks to exportTypeLinks when accessing the target symbol, preventing a nil dereference that occurred when handling certain import error scenarios.

Key Changes:

  • Updated invocationErrorRecovery to use exportTypeLinks instead of valueSymbolLinks for symbol lookup
  • Added a regression test case to verify the crash is fixed

Reviewed Changes

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

Show a summary per file
File Description
internal/checker/checker.go Fixed symbol lookup to use exportTypeLinks instead of valueSymbolLinks
testdata/tests/cases/compiler/invocationErrorRecovery.ts Added test case demonstrating the previously crashing scenario with namespace-style imports
testdata/baselines/reference/compiler/invocationErrorRecovery.types Added baseline for type checking output
testdata/baselines/reference/compiler/invocationErrorRecovery.symbols Added baseline for symbol resolution output
testdata/baselines/reference/compiler/invocationErrorRecovery.errors.txt Added baseline for expected error messages

@ahejlsberg ahejlsberg added this pull request to the merge queue Oct 23, 2025
Merged via the queue into main with commit 8bf36dd Oct 23, 2025
22 checks passed
@ahejlsberg ahejlsberg deleted the fix-1940 branch October 23, 2025 23:25
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.

getting the panic: runtime error: invalid memory address or nil pointer dereference

3 participants