diff --git a/crates/jrsonnet-evaluator/src/import.rs b/crates/jrsonnet-evaluator/src/import.rs index 428257be..d59c6f9e 100644 --- a/crates/jrsonnet-evaluator/src/import.rs +++ b/crates/jrsonnet-evaluator/src/import.rs @@ -71,6 +71,11 @@ impl AsPathLike for IStr { ResolvePath::Str(self) } } +impl AsPathLike for Path { + fn as_path(&self) -> ResolvePath<'_> { + ResolvePath::Path(self) + } +} impl AsPathLike for Cow<'_, Path> { fn as_path(&self) -> ResolvePath<'_> { ResolvePath::Path(self.as_ref()) diff --git a/tests/golden/issue172.jsonnet.golden b/tests/golden/issue172.jsonnet.golden index 8e006414..02259fde 100644 --- a/tests/golden/issue172.jsonnet.golden +++ b/tests/golden/issue172.jsonnet.golden @@ -1,4 +1,4 @@ -variable is not defined: b - issue172.jsonnet:1:45-47: variable access +local is not defined: b + issue172.jsonnet:1:45-47: local access issue172.jsonnet:1:4-10: field access elem <0> evaluation \ No newline at end of file diff --git a/tests/golden/missing_binding.jsonnet.golden b/tests/golden/missing_binding.jsonnet.golden index 4204c9bc..ecd66165 100644 --- a/tests/golden/missing_binding.jsonnet.golden +++ b/tests/golden/missing_binding.jsonnet.golden @@ -1,3 +1,3 @@ -variable is not defined: sta -There is variable with similar name present: std - missing_binding.jsonnet:1:1-5: variable access \ No newline at end of file +local is not defined: sta +There is a local with similar name present: std + missing_binding.jsonnet:1:1-5: local access \ No newline at end of file