Skip to content

unpack::<N> should fail typecheck on rank-M (M != N) shapes #306

@statusfailed

Description

@statusfailed

The problem is here:

            // 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions