cl-interpret: Assignment 2.0, now with more destructuring!

TODO: Destructuring `let`, destructuring patterns in function args..?
This commit is contained in:
2025-01-28 06:23:37 -06:00
parent 485afb7843
commit 145a24c5ff
2 changed files with 210 additions and 53 deletions

View File

@@ -437,16 +437,17 @@ mod operators {
env_eq!(env.y, 10);
env_eq!(env.z, 10);
}
#[test]
#[should_panic]
fn assignment_accounts_for_type() {
let mut env = Default::default();
assert_eval!(env,
let x = "a string";
let y = 0xdeadbeef;
y = x; // should crash: type error
);
}
// Test is disabled, since new assignment system intentionally does not care.
// #[test]
// #[should_panic]
// fn assignment_accounts_for_type() {
// let mut env = Default::default();
// assert_eval!(env,
// let x = "a string";
// let y = 0xdeadbeef;
// y = x; // should crash: type error
// );
// }
#[test]
fn precedence() {
let mut env = Default::default();