Add positional_count field to Lambda
This field is used for static optimization, determining if parameters are purely positional.
This commit is contained in:
@@ -183,4 +183,20 @@ mod tests {
|
||||
panic!("Expected DateTime, got {:?}", res);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_dynamic_call_destructuring_underflow() {
|
||||
let env = Environment::new();
|
||||
let source = "(do
|
||||
(def call-dynamic (fn [f data] (f data)))
|
||||
(def data [10 [20 30]])
|
||||
(def x (fn [[a [b c]]] (+ a (+ b c))))
|
||||
(call-dynamic x data))";
|
||||
|
||||
let result = env.run_script(source);
|
||||
if let Err(e) = &result {
|
||||
panic!("Failed: {}", e);
|
||||
}
|
||||
assert_eq!(format!("{}", result.unwrap()), "60");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user