Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Jun 3, 2024
1 parent 6a3780e commit ec113a1
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions crates/red_knot/src/types/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ mod tests {
use crate::db::tests::TestDb;
use crate::db::{HasJar, SemanticJar};
use crate::module::{
resolve_module, set_module_search_paths, ModuleName, ModuleSearchPath, ModuleSearchPathKind,
set_module_search_paths, ModuleName, ModuleSearchPath, ModuleSearchPathKind,
};
use crate::symbols::{symbol_table, GlobalSymbolId};
use crate::symbols::resolve_global_symbol;
use crate::types::{infer_symbol_public_type, Type};
use crate::Name;
use textwrap::dedent;
Expand Down Expand Up @@ -256,22 +256,10 @@ mod tests {

fn get_public_type(case: &TestCase, modname: &str, varname: &str) -> anyhow::Result<Type> {
let db = &case.db;
let file = resolve_module(db, ModuleName::new(modname))?
.expect("module should be found")
.path(db)?
.file();
let syms = symbol_table(db, file)?;
let sym = syms
.root_symbol_id_by_name(varname)
.expect("symbol should be found");

Ok(infer_symbol_public_type(
db,
GlobalSymbolId {
file_id: file,
symbol_id: sym,
},
)?)
let symbol =
resolve_global_symbol(db, ModuleName::new(modname), varname)?.expect("symbol to exist");

Ok(infer_symbol_public_type(db, symbol)?)
}

fn assert_public_type(
Expand Down

0 comments on commit ec113a1

Please sign in to comment.