mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
Reproduce unused optional fields bug
This commit is contained in:
parent
e93c04a8ce
commit
81a1111cae
1 changed files with 18 additions and 0 deletions
|
@ -662,6 +662,24 @@ mod test_can {
|
|||
assert_eq!(problems, Vec::new());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn optional_field_not_unused() {
|
||||
let src = indoc!(
|
||||
r#"
|
||||
fallbackZ = 3
|
||||
|
||||
fn = \{ x, y, z ? fallbackZ } ->
|
||||
{ x, y, z }
|
||||
|
||||
fn { x: 0, y: 1 }
|
||||
"#
|
||||
);
|
||||
let arena = Bump::new();
|
||||
let CanExprOut { problems, .. } = can_expr_with(&arena, test_home(), src);
|
||||
|
||||
assert_eq!(problems, Vec::new());
|
||||
}
|
||||
|
||||
//#[test]
|
||||
//fn closing_over_locals() {
|
||||
// // "local" should be used, because the closure used it.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue