mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
Merge pull request #3747 from roc-lang/i2419
Add regression tests for #2419
This commit is contained in:
commit
99a22d6bbd
2 changed files with 54 additions and 0 deletions
|
@ -234,6 +234,14 @@ impl Wasm32Result for () {
|
|||
}
|
||||
}
|
||||
|
||||
impl Wasm32Result for std::convert::Infallible {
|
||||
fn build_wrapper_body(code_builder: &mut CodeBuilder, main_function_index: u32) {
|
||||
code_builder.call(main_function_index, 0, false);
|
||||
code_builder.get_global(0);
|
||||
code_builder.build_fn_header_and_footer(&[], 0, None);
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, U> Wasm32Result for (T, U)
|
||||
where
|
||||
T: Wasm32Result + Wasm32Sized,
|
||||
|
|
|
@ -9,6 +9,8 @@ use crate::helpers::wasm::assert_evals_to;
|
|||
|
||||
use indoc::indoc;
|
||||
#[allow(unused_imports)]
|
||||
use roc_std::RocList;
|
||||
#[allow(unused_imports)]
|
||||
use roc_std::RocStr;
|
||||
|
||||
#[test]
|
||||
|
@ -3838,3 +3840,47 @@ fn compose_recursive_lambda_set_productive_inferred() {
|
|||
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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue