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

Ouverte
#64,895 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
52/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
go, typescript
Domaine
compilers

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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)
Langage dominant
Go
Étoiles
112k
Forks
15.4k
Merge moyen
2 j 21 h
PR mergées (30 j)
126

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de microsoft/TypeScript

Toutes les issues de microsoft/TypeScript

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.