diff --git a/prqlc/prqlc/src/semantic/resolver/transforms.rs b/prqlc/prqlc/src/semantic/resolver/transforms.rs index c6a66aa62bb0..ed40af348e2b 100644 --- a/prqlc/prqlc/src/semantic/resolver/transforms.rs +++ b/prqlc/prqlc/src/semantic/resolver/transforms.rs @@ -328,12 +328,12 @@ impl Resolver<'_> { let list_items = list_items .into_iter() .map(|item| { - Expr::new(ExprKind::FuncCall(FuncCall::new_simple( + self.fold_expr(Expr::new(ExprKind::FuncCall(FuncCall::new_simple( func.clone(), vec![item], - ))) + )))) }) - .collect_vec(); + .collect::>>()?; return Ok(Expr { kind: ExprKind::Tuple(list_items), diff --git a/prqlc/prqlc/tests/integration/sql.rs b/prqlc/prqlc/tests/integration/sql.rs index 314742e6916a..94cf40fcc492 100644 --- a/prqlc/prqlc/tests/integration/sql.rs +++ b/prqlc/prqlc/tests/integration/sql.rs @@ -7275,3 +7275,22 @@ fn test_partial_application_of_transform() { 10 "); } + +#[test] +fn test_tuple_map() { + assert_snapshot!(compile(r###" + let add_four = func a -> a + 4 + + from foo + select {x, y} + derive (tuple_map add_four foo.*) + "###).unwrap(), @" + SELECT + x, + y, + x + 4, + y + 4 + FROM + foo + "); +}