panic: Unhandled case in Node.MemberList: KindVariableDeclarationList on merged namespace/enum element access

Offen
#64,895 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
52/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
go, typescript
Bereich
compilers

Rechercherichtung

Start by comparing the compiler path that handles merged namespace and enum element access with the related #64668 fix in PR #64746. Reproduce with the provided Foo namespace and enum example, then trace how Node.MemberList handles KindVariableDeclarationList. Done means the compiler no longer panics and reports a type error or handles the case gracefully.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Bug
🔎 Search Terms

panic Unhandled case Node.MemberList KindVariableDeclarationList merged namespace enum element access

🕗 Version & Regression Information

This changed between versions 6.0.3 and 7.0.2

⏯ Playground Link

No response

💻 Code
namespace Foo { export const BAR = 42; }
enum Foo { BAZ = Foo["BAR"] }
🙁 Actual behavior

tsc panics with:

panic: Unhandled case in Node.MemberList: KindVariableDeclarationList [recovered, repanicked]

The compiler crashes instead of emitting a type error or handling gracefully.

🙂 Expected behavior

tsc should emit a type error (e.g. TS2304 or similar) or
handle the merged namespace/enum case gracefully without crashing.
TypeScript 5.x handles this without panicking.

Additional information about the issue

This is a variant of #64668 (KindModuleBlock panic) but triggered
by export const instead of export class in the namespace.

The fix PR #64746 targets KindModuleBlock it likely does not
cover KindVariableDeclarationList.

Tested on:

  • TypeScript 7.0.2 → panics (KindVariableDeclarationList)
  • TypeScript 5.8.3 → throws JS TypeError (no panic, no crash)
Vorherrschende Sprache
Go
Sterne
112k
Forks
15.4k
Ø Merge
3 T. 6 Std.
Gemergte PRs (30 T.)
136

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/TypeScript

Alle Issues in microsoft/TypeScript

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.