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

オープン
#64,895 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go, typescript
領域
compilers

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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)
主要言語
Go
スター
112k
フォーク
15.4k
平均マージ
3日 6時間
マージ済み PR(30日)
136

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/TypeScript のほかの issue

microsoft/TypeScript の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。