You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(rust): replace .expect("TODO") anti-pattern across typell crates (29 sites)
29 .expect("TODO: handle error") sites cleared across typell-core,
typell-eclexia, typell-wokelang.
Prod (4 sites — typell-core/src/proof.rs):
ObligationCollector::add_*() each does `self.obligations.push(...)`
followed by `self.obligations.last().expect(...)`. The expect message
becomes a documented invariant: "Vec::last() after a Vec::push() on
the same line is statically guaranteed to be Some". This message is
a SPARK proof candidate per estate-wide direction.
Tests (25 sites — revert to .unwrap()):
- typell-core/src/check.rs: 2 sites (infer_var, unify)
- typell-core/src/dimensional.rs: 6 sites (binary_op result unwrap)
- typell-eclexia/src/resource.rs: 8 sites (resource_type_for_name +
linear_resource_type + check_resource_op tests)
- typell-wokelang/src/rules.rs: 1 site (check_measured_op)
All inside #[cfg(test)] / #[test] blocks where .unwrap() is correct.
Verified clean: cargo test --lib --workspace passes 235 tests across
13 lib suites. Pre-existing E0433/E0282 errors in
typell-vcl/tests/vcl_bridge_tests.rs (uses old `typell_vql` import path
from the unfinished VQL→VCL rename in 2936952) are NOT related to this
sweep.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments