Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser: object destructuring in ambient module/namespace #5958

Closed
DonIsaac opened this issue Sep 21, 2024 · 0 comments · Fixed by #6020
Closed

parser: object destructuring in ambient module/namespace #5958

DonIsaac opened this issue Sep 21, 2024 · 0 comments · Fixed by #6020
Assignees
Labels
A-parser Area - Parser C-bug Category - Bug

Comments

@DonIsaac
Copy link
Contributor

DonIsaac commented Sep 21, 2024

This code should parse with no errors

declare module "foo" {
    let {a: x, b: x1}: {a: number, b: number}; // valid b/c ambient context
}

declare namespace Bar {
    let {a: x, b: x1}: {a: number, b: number}; // valid b/c ambient context
}

But it errors with

Error: Missing initializer in destructuring declaration

It looks like Context::Ambient is not getting updated correctly, even though it should be in parse_ts_declaration_statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area - Parser C-bug Category - Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants