diff --git a/crates/aiken-lang/src/expr.rs b/crates/aiken-lang/src/expr.rs index 5062319d..1919c5b1 100644 --- a/crates/aiken-lang/src/expr.rs +++ b/crates/aiken-lang/src/expr.rs @@ -371,12 +371,17 @@ impl TypedExpr { TypedExpr::Tuple { elems: elements, .. - } - | TypedExpr::List { elements, .. } => elements + } => elements .iter() .find_map(|e| e.find_node(byte_index)) .or(Some(Located::Expression(self))), + TypedExpr::List { elements, tail, .. } => elements + .iter() + .find_map(|e| e.find_node(byte_index)) + .or_else(|| tail.as_ref().and_then(|t| t.find_node(byte_index))) + .or(Some(Located::Expression(self))), + TypedExpr::Call { fun, args, .. } => args .iter() .find_map(|arg| arg.find_node(byte_index))