fix: nested module resolution bug

This commit is contained in:
Shunsuke Shibayama 2024-02-01 02:08:07 +09:00
parent 83aae24317
commit ded10fc3d9
7 changed files with 51 additions and 24 deletions

View file

@ -5522,6 +5522,7 @@ pub enum DefKind {
PyImport,
RsImport,
Patch,
InlineModule,
/// type alias included
Other,
}
@ -5556,6 +5557,10 @@ impl DefKind {
self.is_erg_import() || self.is_py_import() || self.is_rs_import()
}
pub fn is_inline_module(&self) -> bool {
matches!(self, Self::InlineModule)
}
pub const fn is_other(&self) -> bool {
matches!(self, Self::Other)
}
@ -5607,6 +5612,7 @@ impl DefBody {
Some("rsimport") => DefKind::RsImport,
_ => DefKind::Other,
},
Expr::InlineModule(_) => DefKind::InlineModule,
_ => DefKind::Other,
}
}