mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
parent
657346a057
commit
e31a16f650
5 changed files with 130 additions and 61 deletions
|
@ -1263,3 +1263,24 @@ fn record_of_poly_function_and_string() {
|
|||
r#"{ a: <function>, b: "b" } : { a : * -> Str, b : Str }"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn newtype_by_void_is_wrapped() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
Result.try (Err 42) (\x -> Err (x+1))
|
||||
"#
|
||||
),
|
||||
r#"Err 42 : Result b (Num *)"#,
|
||||
);
|
||||
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
Result.try (Ok 42) (\x -> Ok (x+1))
|
||||
"#
|
||||
),
|
||||
r#"Ok 43 : Result (Num *) err"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue