diff --git a/src/imp/parser.rs b/src/imp/parser.rs index dde651ba5..9e8b14c3d 100644 --- a/src/imp/parser.rs +++ b/src/imp/parser.rs @@ -95,7 +95,7 @@ impl<'a> PyParser<'a> { } } let names = self.list_like(|p| parse_lam_var(p), "", ":", ",", false, 1)?; - let bod = self.parse_expr(inline, true)?; + let bod = self.parse_expr(inline, false)?; Ok(Expr::Lam { names, bod: Box::new(bod) }) } else if self.starts_with("(") { self.advance_one(); diff --git a/tests/golden_tests/run_file/filter_bool_id.bend b/tests/golden_tests/run_file/filter_bool_id.bend new file mode 100644 index 000000000..f8d49cd40 --- /dev/null +++ b/tests/golden_tests/run_file/filter_bool_id.bend @@ -0,0 +1,17 @@ +type Bool: + T + F + +def filter(f, ls): + match ls: + case List/Nil: + return List/Nil + case List/Cons: + match f(ls.head): + case Bool/T: + return List/Cons(ls.head, filter(f, ls.tail)) + case Bool/F: + return filter(f, ls.tail) + +def main: + return filter(lambda x: x, [Bool/T]) diff --git a/tests/snapshots/run_file__filter_bool_id.bend.snap b/tests/snapshots/run_file__filter_bool_id.bend.snap new file mode 100644 index 000000000..760ed391e --- /dev/null +++ b/tests/snapshots/run_file__filter_bool_id.bend.snap @@ -0,0 +1,9 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/run_file/filter_bool_id.bend +--- +NumScott: +[Bool/T] + +Scott: +[Bool/T]