Skip to content

declare namespace { using ... } generates incorrect dts #61752

Closed
@JLHwung

Description

@JLHwung

πŸ”Ž Search Terms

ambient context, declare namespace, using, await using

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.9.0-dev.20250522#code/CYUwxgNghgTiAEA7KBbEBnADlMCBqUEAlsFAC5ED2i8A3gFDzwCu6RiA5vFAFzeIBPANz0AvkA

πŸ’» Code

declare namespace Validation {
  using a: any;
}

πŸ™ Actual behavior

In the generated dts, a becomes a const declarator:

declare namespace Validation {
    const a: any;
}

πŸ™‚ Expected behavior

The generated dts should be the same as the input

declare namespace Validation {
  using a: any;
}

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions