Closed DTibbs closed 4 years ago
Slightly more testing, and this appears to only happen to the first argument passed to an imported function:
I tested the following in tests/modules.rs
's test_module_resolver
on master
assert_eq!(
engine.eval::<INT>(
r#"
import "hello" as h;
let foo = 42;
let bar = -1;
//let foobar = h::sum(0, foo, bar, 1); // <-- this one works
let foobar = h::sum(foo, 0, bar, 1); // <-- this one turns 'foo' into '()'
foo
"#
)?,
42
);
Thanks for picking this up.
This seems to be a bug.
If you pull from this repo, the bug has been fixed. Please test.
Thanks for detecting this.
If you find no more problems, I'll push out a 0.18.2
to crates.io
.
👍 Fix looks good.
Tested above mentioned steps, and in my project's use-case. No longer see the issue.
Thanks for the quick turnaround! Anxiously awaiting 0.18.2
on crates.io
0.18.2
is uploaded to crates.io
.
I ran into this issue in a bit more complex environment, but was able to reproduce using the examples from the repo as of v0.18.1.
Steps to reproduce:
import.rhai
in the ./scripts dirimport.rhai
:rhai_runner
example with:cargo run --example rhai_runner -- scripts/import.rhai
Expected result:
I checked previous versions, and this worked as expected in
v0.16.1
.v0.17.0
appears to be when this behavior was introduced.