Skip to content

Prevent noLib crash when an import-equals alias references a type - #64902

Draft
Ryan Cavanaugh (RyanCavanaugh) with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-nil-pointer-crash
Draft

Ryan Cavanaugh (RyanCavanaugh) with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-nil-pointer-crash

Conversation

Copilot AI commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #64725

Analysis

Under --noLib, missing-global diagnostics can resolve import aliases before globalObjectType is initialized. The property lookup used to refine the type-as-namespace error then dereferences nil:

interface C {}
import x = C.m;

Fix

  • Guard the property-specific diagnostic lookup until globalObjectType is available; otherwise report the ordinary type-as-namespace error.
  • Add the minimal reproducer and diagnostic, emit, type, and symbol baselines.

Copilot Checklist

I successfully ran the applicable command:

  • npx hereby validate
  • npx hereby validate --api (not applicable)

Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 21, 2026
…ation

Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix crash due to nil pointer in getPropertyOfObjectType Prevent noLib crash when an import-equals alias references a type Oct 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash (nil pointer in getPropertyOfObjectType) under --noLib when a global import x = T.m names a type

2 participants