From 2b65f68c21229b1b4bcdbd7a5e1564d51f6472cf Mon Sep 17 00:00:00 2001 From: Denis Bezrukov <6227442+denbezrukov@users.noreply.github.com> Date: Thu, 21 Sep 2023 22:29:05 +0300 Subject: [PATCH] fix(analyzer): False positive in rule noUndeclaredVariables #243 --- crates/biome_js_semantic/src/events.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/biome_js_semantic/src/events.rs b/crates/biome_js_semantic/src/events.rs index ff8560516ab7..844eb92147bd 100644 --- a/crates/biome_js_semantic/src/events.rs +++ b/crates/biome_js_semantic/src/events.rs @@ -325,7 +325,7 @@ impl SemanticEventExtractor { ); } _ => { - if let Some(node) = node.clone().cast::() { + if let Some(node) = AnyTsType::cast_ref(node) { self.enter_any_type(&node); } } @@ -595,7 +595,7 @@ impl SemanticEventExtractor { self.pop_scope(node.text_range()); } _ => { - if let Some(node) = node.clone().cast::() { + if let Some(node) = AnyTsType::cast_ref(node) { self.leave_any_type(&node); } }