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

fix(lint/noSelfAssign): don't panic #549

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

### Linter

#### Bug fixes

- Fix [#548](https://github.com/biomejs/biome/issues/548) which made [noSelfAssign](https://biomejs.dev/linter/rules/no-self-assign) panic.

### Parser

### VSCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ pub(crate) enum IdentifiersLike {
}

impl TryFrom<(AnyNameLike, AnyNameLike)> for IdentifiersLike {
type Error = SyntaxError;
type Error = ();

fn try_from((left, right): (AnyNameLike, AnyNameLike)) -> Result<Self, Self::Error> {
match (left, right) {
Expand All @@ -713,7 +713,7 @@ impl TryFrom<(AnyNameLike, AnyNameLike)> for IdentifiersLike {
AnyNameLike::AnyJsLiteralExpression(right),
) => Ok(Self::Literal(left, right)),

_ => unreachable!("you should map the correct references"),
_ => Err(()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the unreachable was there for a reason, which means we haven't mapped a specific type that we should

}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// See https://github.com/biomejs/biome/issues/548
a[c] = b[0];
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: crates/biome_js_analyze/tests/spec_tests.rs
expression: issue548.js
---
# Input
```js
// See https://github.com/biomejs/biome/issues/548
a[c] = b[0];
```


4 changes: 4 additions & 0 deletions website/src/content/docs/internals/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

### Linter

#### Bug fixes

- Fix [#548](https://github.com/biomejs/biome/issues/548) which made [noSelfAssign](https://biomejs.dev/linter/rules/no-self-assign) panic.

### Parser

### VSCode
Expand Down