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

semantic: incorrect semantic check for has same name LabeledStatement nested in LabeledStatement #5036

Closed
Dunqing opened this issue Aug 21, 2024 · 1 comment · Fixed by #5041
Labels
A-semantic Area - Semantic C-bug Category - Bug good first issue Experience Level - Good for newcomers

Comments

@Dunqing
Copy link
Member

Dunqing commented Aug 21, 2024

Reproduction:

This bug was found in https://github.com/oxc-project/monitor-oxc/actions/runs/10482911458/job/29034791059

Minimal reproduction

oxc playground

TOP: {
  L: console.log(1);
  L: console.log(2);
};

The above code reports the following errors in the playground

❗ Identifier `L` has already been declared
❗ Identifier `L` has already been declared

Expected result

There are no semantic errors. I've run the code in Chrome devtools and that works well

@Dunqing Dunqing added C-bug Category - Bug good first issue Experience Level - Good for newcomers A-semantic Area - Semantic labels Aug 21, 2024
@Boshen
Copy link
Member

Boshen commented Aug 21, 2024

We first need to change the diagnostic here

ctx.error(redeclaration(labeled.name, *span, labeled.span));

And then figure out what's wrong in the label builder https://github.com/oxc-project/oxc/blob/main/crates/oxc_semantic/src/label.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-semantic Area - Semantic C-bug Category - Bug good first issue Experience Level - Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants