Add unbound runtime error function var gen test

This commit is contained in:
ayazhafiz 2022-07-06 00:04:41 -04:00 committed by Ayaz Hafiz
parent ab75de39d6
commit efbd1bf4c7
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -2974,3 +2974,21 @@ fn call_function_in_empty_list() {
RocList<()>
)
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
// TODO to be improved, if we can generate the void function type for the function in the list,
// this should succeed.
#[should_panic(expected = r#"Roc failed with message: "#)]
fn call_function_in_empty_list_unbound() {
assert_evals_to!(
indoc!(
r#"
lst = []
List.map lst \f -> f {}
"#
),
RocList::from_slice(&[]),
RocList<()>
)
}