mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 05:34:11 +03:00
Reproduce unused optional fields bug
This commit is contained in:
parent
e93c04a8ce
commit
81a1111cae
@ -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…
Reference in New Issue
Block a user