mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
parse default optional expressions in pattern matches
This commit is contained in:
parent
6d40de7430
commit
d779e68773
6 changed files with 209 additions and 26 deletions
|
@ -2629,4 +2629,16 @@ mod solve_expr {
|
|||
"{ a : { x : Num a, y : Float, z : c }, b : { blah : Str, x : Num a, y : Float, z : c } }",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn optional_field_function() {
|
||||
infer_eq_without_problem(
|
||||
indoc!(
|
||||
r#"
|
||||
\{ x, y ? 0 } -> x + y
|
||||
"#
|
||||
),
|
||||
"{ x : Num a, y ? Num a }* -> Num a",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue