MCPcopy Create free account
hub / github.com/argumentcomputer/ix / save_and_restore_depth_basic

Function save_and_restore_depth_basic

crates/kernel/src/tc.rs:1466–1475  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1464 tc.push_local(var(3));
1465 tc.push_local(sort1());
1466 let t = tc.lookup_var(1).unwrap();
1467 // Lifted from Var(3) with lift-by-(idx+1)=2 → Var(3+2)=Var(5).
1468 // The implementation calls `lift(&intern, &ty, idx + 1, 0)` which
1469 // shifts all free bvars by idx+1.
1470 match t.data() {
1471 ExprData::Var(i, _, _) => assert_eq!(*i, 5),
1472 other => panic!("expected Var, got {other:?}"),
1473 }
1474 }
1475
1476 #[test]
1477 fn lookup_let_val_returns_none_for_lambda_binding() {
1478 let mut tc = new_tc();

Callers

nothing calls this directly

Calls 6

new_tcFunction · 0.85
push_localMethod · 0.80
save_depthMethod · 0.80
restore_depthMethod · 0.80
sort0Function · 0.70
sort1Function · 0.70

Tested by

no test coverage detected