mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Reproduce transitively used function bug
This commit is contained in:
parent
2e12651858
commit
18d74230ac
1 changed files with 23 additions and 0 deletions
|
@ -306,6 +306,29 @@ mod test_canonicalize {
|
||||||
}.into());
|
}.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn transitively_used_function() {
|
||||||
|
// This should report that neither a nor b are unused,
|
||||||
|
// since if you never call a function but do return it, that's okay!
|
||||||
|
let (_, output, problems, _) = can_expr(indoc!(r#"
|
||||||
|
a = \_ -> 42
|
||||||
|
b = a
|
||||||
|
|
||||||
|
b
|
||||||
|
"#));
|
||||||
|
|
||||||
|
assert_eq!(problems, Vec::new());
|
||||||
|
|
||||||
|
assert_eq!(output, Out {
|
||||||
|
locals: vec!["a", "b"],
|
||||||
|
globals: vec![],
|
||||||
|
variants: vec![],
|
||||||
|
calls: vec![],
|
||||||
|
tail_call: None
|
||||||
|
}.into());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ASSIGNMENT REORDERING
|
// ASSIGNMENT REORDERING
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue