Add regression tests for #2419

Closes #2419
This commit is contained in:
Ayaz Hafiz 2022-08-10 15:33:58 -07:00
parent 0fab77af99
commit aa26a0da44
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -9,6 +9,8 @@ use crate::helpers::wasm::assert_evals_to;
use indoc::indoc; use indoc::indoc;
#[allow(unused_imports)] #[allow(unused_imports)]
use roc_std::RocList;
#[allow(unused_imports)]
use roc_std::RocStr; use roc_std::RocStr;
#[test] #[test]
@ -3838,3 +3840,47 @@ fn compose_recursive_lambda_set_productive_inferred() {
RocStr RocStr
); );
} }
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn local_binding_aliases_function() {
assert_evals_to!(
indoc!(
r#"
app "test" provides [ main ] to "./platform"
f : {} -> List a
f = \_ -> []
main : List U8
main =
g = f
g {}
"#
),
RocList::<u8>::from_slice(&[]),
RocList<u8>
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn local_binding_aliases_function_inferred() {
assert_evals_to!(
indoc!(
r#"
app "test" provides [ main ] to "./platform"
f = \_ -> []
main =
g = f
g {}
"#
),
RocList::from_slice(&[]),
RocList<std::convert::Infallible>
);
}