This commit is contained in:
Michael Schimmel
2026-02-21 15:18:29 +01:00
parent 9222fb5bc8
commit d645f36700
2 changed files with 8 additions and 10 deletions
+6 -8
View File
@@ -681,15 +681,13 @@ impl VM {
BoundKind::Tuple { elements } => {
// If the current value at offset is a Tuple or Record, we dive into it.
// Otherwise, we assume the sequence was already flattened (e.g. by Specializer).
if let Some(val) = values.get(*offset) {
if let Some(sub_values) = val.as_slice() {
*offset += 1;
let mut sub_offset = 0;
for el in elements {
self.unpack(el, sub_values, &mut sub_offset)?;
}
return Ok(());
if let Some(sub_values) = values.get(*offset).and_then(|v| v.as_slice()) {
*offset += 1;
let mut sub_offset = 0;
for el in elements {
self.unpack(el, sub_values, &mut sub_offset)?;
}
return Ok(());
}
for el in elements {