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

🐛 noUnusedVariables makes the semantic model panics on invalid code #4114

Closed
1 task done
Conaclos opened this issue Sep 28, 2024 · 0 comments · Fixed by #4144
Closed
1 task done

🐛 noUnusedVariables makes the semantic model panics on invalid code #4114

Conaclos opened this issue Sep 28, 2024 · 0 comments · Fixed by #4144
Assignees
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@Conaclos
Copy link
Member

Conaclos commented Sep 28, 2024

Environment information

Main

What happened?

Given the following file named main,js:

c;
const c = 0;

Execute the following command:

biome lint --only=correctness/noUnusedVariables main.js

And then notice the panics:

Biome encountered an unexpected error

This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:

Source Location: crates/biome_js_semantic/src/semantic_model/model.rs:138:21
Thread Name: biome::worker_4
Message: internal error: entered unreachable code: Expected global scope not present

main.js internalError/panic  INTERNAL  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ processing panicked: internal error: entered unreachable code: Expected global scope not present
  
  ⚠ This diagnostic was derived from an internal Biome error. Potential bug, please report it if necessary.
  

Checked 0 files in 1558µs. No fixes applied.
internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ No files were processed in the specified paths.

Expected result

Biome should not panic.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Conaclos Conaclos added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Sep 28, 2024
@Conaclos Conaclos self-assigned this Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant