Properly wrap with newtype-by-void layouts in repl

Closes #4208
This commit is contained in:
Ayaz Hafiz 2022-10-05 11:17:57 -05:00
parent 657346a057
commit e31a16f650
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
5 changed files with 130 additions and 61 deletions

View file

@ -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"#,
);
}