mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
Fix List.first types
This commit is contained in:
parent
b3dfbeeec8
commit
0f36255f83
8 changed files with 90 additions and 62 deletions
|
@ -525,6 +525,15 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
Symbol::LIST_GET,
|
||||
unique_function(
|
||||
vec![list_type(UVAR1, TVAR1), int_type(UVAR2)],
|
||||
result_type(UVAR3, flex(TVAR1), lift(UVAR4, index_out_of_bounds.clone())),
|
||||
),
|
||||
);
|
||||
|
||||
// first : List elem -> Result elem [ OutOfBounds ]*
|
||||
add_type(
|
||||
Symbol::LIST_FIRST,
|
||||
unique_function(
|
||||
vec![list_type(UVAR1, TVAR1)],
|
||||
result_type(UVAR3, flex(TVAR1), lift(UVAR4, index_out_of_bounds)),
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue