Skip to content

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

Open

Description

πŸ”Ž 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)

Activity

  1. Andarist commented on Oct 21, 2026

    @Andarist
    Contributor

    this is already being fixed by #64746

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions