diff --git a/crates/jrsonnet-evaluator/src/async_import.rs b/crates/jrsonnet-evaluator/src/async_import.rs index 0be90bc6..dd0b8c4c 100644 --- a/crates/jrsonnet-evaluator/src/async_import.rs +++ b/crates/jrsonnet-evaluator/src/async_import.rs @@ -9,7 +9,7 @@ use jrsonnet_parser::{ SourcePath, }; -use crate::{gc::GcHashMap, throw, FileData, ImportResolver, State}; +use crate::{bail, gc::GcHashMap, FileData, ImportResolver, State}; pub struct Import { path: IStr, @@ -179,9 +179,11 @@ pub fn find_imports(expr: &LocExpr, out: &mut FoundImports) { find_imports(expr, out); in_args(args, out); } - Expr::Index(expr, index) => { - find_imports(expr, out); - find_imports(index, out); + Expr::Index { indexable, parts } => { + find_imports(indexable, out); + for part in parts { + find_imports(&part.value, out); + } } Expr::Function(params, expr) => { in_params(params, out); @@ -262,7 +264,7 @@ impl ImportResolver for ResolvedImportResolver { } fn resolve(&self, path: &Path) -> crate::Result { - throw!(crate::error::ErrorKind::AbsoluteImportNotSupported( + bail!(crate::error::ErrorKind::AbsoluteImportNotSupported( path.to_owned() )) }