Skip to content

Commit

Permalink
Fix red-knot compilation (#11727)
Browse files Browse the repository at this point in the history
## Summary

Perhaps a result of a bad rebase, but `cargo clippy --fix --workspace
--all-targets -- -D warnings` does not pass on main as-is.
  • Loading branch information
charliermarsh authored Jun 4, 2024
1 parent 3fb2028 commit 2f8ac1e
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions crates/red_knot/src/types/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()?;
Expand Down

0 comments on commit 2f8ac1e

Please sign in to comment.