fixes recursive imports issue

This commit is contained in:
yangvenli 2021-08-17 15:47:16 +03:00
parent 8f7485977a
commit b6d9db20be

View File

@ -55,10 +55,9 @@ impl<'a> ImportResolver<'a> for ImportParser<'a> {
if let Some(program) = self.imports.get(&full_path) {
return Ok(Some(program.clone()));
}
let mut imports = Self::default();
let path = self.program_path.clone();
self.partial_imports.insert(full_path.clone());
let mut imports = self.clone(); // Self::default() was previously
let program = imports
.parse_package(context, path, package_segments, span)
.map_err(|x| -> AsgConvertError { x.into() })?;