Reproduce unused optional fields bug

This commit is contained in:
Richard Feldman 2020-07-20 21:44:39 -04:00
parent e93c04a8ce
commit 81a1111cae

View File

@ -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.