unpack::<N> should fail typecheck on rank-M (M != N) shapes
- Dominant language
- Rust
- Stars
- 34
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
The problem is [here](https://github.com/hellas-ai/catgrad/blob/master/catgrad/src/abstract_interpreter/eval.rs#L58):
```rust
// write each result into state at op.targets ids
for ((node_id, _), result) in ssa.targets.iter().zip(results) {
on_write(*node_id, &result);
if state.insert(*node_id, result).is_some() {
return Err(InterpreterError::MultipleWrite(*node_id));
}
}
```
Namely: rust's `zip` is silently truncating one of the iterators.
**Fix**: insert a length check that there are exactly as many results as targets.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.