Skip to content

Commit 108cf1a

Browse files
committed
Ensure files are loaded after imports for PreClassCalculationLookup, this was an issue in primer
1 parent 1839dda commit 108cf1a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • crates/zuban_python/src/file/type_computation

‎crates/zuban_python/src/file/type_computation/alias.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,9 @@ impl<'db, 'file> NameResolution<'db, 'file, '_> {
10291029
TypeLike::DottedAsName(dotted) => {
10301030
if let Some(ImportResult::File(f)) =
10311031
node_ref.file.cache_dotted_as_name_import(db, dotted)
1032+
&& let Ok(file) = db.ensure_file_for_file_index(f)
10321033
{
1033-
return PreClassCalculationLookup::Module(db.loaded_python_file(f));
1034+
return PreClassCalculationLookup::Module(file);
10341035
}
10351036
}
10361037
_ => (),

0 commit comments

Comments
 (0)