Skip to content

Fix crash on inherited export type * members - #65823

Open
Max Schwenk (maschwenk) wants to merge 1 commit into
microsoft:mainfrom
maschwenk:fix-inherited-type-only-export-star-member
Open

Max Schwenk (maschwenk) wants to merge 1 commit into
microsoft:mainfrom
maschwenk:fix-inherited-type-only-export-star-member

Conversation

@maschwenk

Copy link
Copy Markdown
Contributor

Fixes #65821

This is an automated PR authored by Claude Code using Claude Opus 5.5 with Extra High reasoning level.

Motivation & Guidance

Motivation: The user asked me to fix #65821.

Guidance:

get a subagent to fix the upstream Go crash on an aws box

Analysis

Since #64915 (8d9b6da), layout member names for a module base typeof ns come from getPropertiesOfType, which includes export type * members. getPropertyAt fills each slot with getPropertyOfType, which returns nil for typeOnlyExportStarMap members. Spreads and value.x crash on the nil slot. Before #64915, the class copied getPropertiesOfType's symbols. 6.0 and 7.1.0-beta report no errors.

Fix

getPropertyAt now calls getPropertyOfTypeEx with includeTypeOnlyMembers to find export type * members. Omitting them from the layout would make value.x an error. Hiding them from getPropertiesOfType would change keyof typeof ns.

The new test crashes on main under both strict settings. No other baselines change.

@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 5, 2026
@maschwenk
Max Schwenk (maschwenk) marked this pull request as ready for review December 5, 2026 15:12
Copilot AI balanced review requested due to automatic review settings December 5, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the inherited type-only member resolution fix.

No open issues 🎉

What changed in this PR

Fixes #65821, a compiler crash introduced by lazy member resolution when a class inherits namespace members from export type *.

Changes:

  • Includes type-only members when resolving inherited property slots.
  • Adds regression coverage for object spreads and property access with strict mode enabled and disabled.
  • Records expected type and symbol baselines.
File Description
tsc/​testdata/​tests/​cases/​compiler/​inheritedTypeOnlyExportStarMember.ts Tests both strict settings.
tsc/​testdata/​baselines/​reference/​compiler/​inheritedTypeOnlyExportStarMember(strict=true).types Records strict-mode types.
tsc/​testdata/​baselines/​reference/​compiler/​inheritedTypeOnlyExportStarMember(strict=true).symbols Records strict-mode symbols.
tsc/​testdata/​baselines/​reference/​compiler/​inheritedTypeOnlyExportStarMember(strict=false).types Records non-strict types.
tsc/​testdata/​baselines/​reference/​compiler/​inheritedTypeOnlyExportStarMember(strict=false).symbols Records non-strict symbols.
tsc/​internal/​checker/​types.go Resolves inherited type-only members without leaving nil slots.

Review effort: Balanced

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nil pointer crash in checkSpreadPropOverrides spreading a class instance whose base is typeof a namespace with export type *

2 participants