Use actual outer scope for function-bang calls.
This commit is contained in:
@@ -164,5 +164,22 @@ fn test_functions_bang() -> Result<(), Box<EvalAltResult>> {
|
||||
165
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
engine.eval::<INT>(
|
||||
"
|
||||
fn foo() {
|
||||
hello = 0;
|
||||
hello + bar
|
||||
}
|
||||
|
||||
let hello = 42;
|
||||
let bar = 123;
|
||||
|
||||
foo!()
|
||||
",
|
||||
)?,
|
||||
123
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user