From 2f8ac1e9b3246539fc0e179f63239865311e68d5 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 3 Jun 2024 23:03:38 -0400 Subject: [PATCH] Fix `red-knot` compilation (#11727) ## Summary Perhaps a result of a bad rebase, but `cargo clippy --fix --workspace --all-targets -- -D warnings` does not pass on main as-is. --- crates/red_knot/src/types/infer.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/crates/red_knot/src/types/infer.rs b/crates/red_knot/src/types/infer.rs index 6a89caa1ec14e..59cc771a6cc1e 100644 --- a/crates/red_knot/src/types/infer.rs +++ b/crates/red_knot/src/types/infer.rs @@ -213,15 +213,16 @@ fn infer_expr_type(db: &dyn SemanticDb, file_id: FileId, expr: &ast::Expr) -> Qu #[cfg(test)] mod tests { + use textwrap::dedent; + use crate::db::tests::TestDb; use crate::db::{HasJar, SemanticJar}; use crate::module::{ - set_module_search_paths, ModuleName, ModuleSearchPath, ModuleSearchPathKind, + resolve_module, set_module_search_paths, ModuleName, ModuleSearchPath, ModuleSearchPathKind, }; - use crate::symbols::resolve_global_symbol; + use crate::symbols::{resolve_global_symbol, symbol_table, GlobalSymbolId}; use crate::types::{infer_symbol_public_type, Type}; use crate::Name; - use textwrap::dedent; // TODO with virtual filesystem we shouldn't have to write files to disk for these // tests @@ -388,15 +389,6 @@ mod tests { assert_public_type(&case, "a", "x", "(Literal[1] | Literal[2])") } - #[test] - fn resolve_visible_def() -> anyhow::Result<()> { - let case = create_test()?; - - write_to_path(&case, "a.py", "y = 1; y = 2; x = y")?; - - assert_public_type(&case, "a", "x", "Literal[2]") - } - #[test] fn resolve_visible_def() -> anyhow::Result<()> { let case = create_test()?;