Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

home-anchored imports don't work #223

Closed
s-zeng opened this issue Nov 25, 2021 · 0 comments · Fixed by #224
Closed

home-anchored imports don't work #223

s-zeng opened this issue Nov 25, 2021 · 0 comments · Fixed by #224

Comments

@s-zeng
Copy link

s-zeng commented Nov 25, 2021

Forwarded from s-zeng/dhall-python#41

According to the dhall documentation, the dhall language supports home-anchored imports as shown in the following example. dhall-rust however seems to support only the relative and absolute imports, but not the home-anchored import.

> dhall <<< '~/test.dhall'
"hello"

> cat src/main.rs
fn main() {
    let str_a = "./test.dhall";
    let str_b = "~/test.dhall";
    let local_test = serde_dhall::from_str(str_a).parse::<String>();
    let home_test = serde_dhall::from_str(str_b).parse::<String>();
    println!("Local import: {:?}", local_test);
    println!("Home import: {:?}", home_test);
}

> cargo run
Local import: Ok("hello")
Home import: Err(Error(Dhall(Error { kind: Typecheck(TypeError { message: Custom("error: error\n --> <current file>:1:1\n  |\n1 | ~/test.dhall\n  | ^^^^^^^^^^^^ No such file or directory (os error 2)\n  |") }) })))

Tested with serde_dhall 0.10

Thank you @padhla for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant