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

@ -51,10 +51,12 @@ pub enum SubstituteResult {
}
impl Context {
/// Returns `true` if the module is being inspected, or has been inspected
pub(crate) fn mod_registered(&self, path: &NormalizedPathBuf) -> bool {
(self.shared.is_some() && self.promises().is_registered(path)) || self.mod_cached(path)
}
/// Returns `true` if the module has been inspected
pub(crate) fn mod_cached(&self, path: &Path) -> bool {
self.mod_cache().get(path).is_some() || self.py_mod_cache().get(path).is_some()
}