Typecheck and compile opaque wrapping functions

This enables you to write something like

```
A := U8
List.map [1, 2, 3] @A
```

which will be compiled as if it was `List.map [1, 2, 3] \x -> @A x`.

Closes #3499
This commit is contained in:
Ayaz Hafiz 2022-07-12 18:38:03 -04:00
parent d889f1fda9
commit f1a6ea6a40
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
9 changed files with 360 additions and 15 deletions

View file

@ -1179,3 +1179,16 @@ fn render_nullable_unwrapped_passing_through_alias() {
"Cons (L (Cons (L (Cons (L Nil))))) : DeepList",
)
}
#[test]
fn opaque_wrap_function() {
expect_success(
indoc!(
r#"
A a := a
List.map [1u8, 2u8, 3u8] @A
"#
),
"[1, 2, 3] : List (A U8)",
);
}