mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-10 02:59:34 +00:00
Fix tuple accessor type printing
This commit is contained in:
parent
de828416bf
commit
303e5bceb3
3 changed files with 30 additions and 3 deletions
|
|
@ -3801,8 +3801,15 @@ fn adjust_rank_content(
|
|||
rank
|
||||
}
|
||||
|
||||
Tuple(_elems, _ext_var) => {
|
||||
todo!()
|
||||
Tuple(elems, ext_var) => {
|
||||
let mut rank = adjust_rank(subs, young_mark, visit_mark, group_rank, *ext_var);
|
||||
|
||||
for (_, var_index) in elems.iter_all() {
|
||||
let var = subs[var_index];
|
||||
rank = rank.max(adjust_rank(subs, young_mark, visit_mark, group_rank, var));
|
||||
}
|
||||
|
||||
rank
|
||||
}
|
||||
|
||||
TagUnion(tags, ext_var) => {
|
||||
|
|
|
|||
|
|
@ -1489,6 +1489,14 @@ mod solve_expr {
|
|||
infer_eq("(5, 3.14 )", "( Num *, Float * )*");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tuple_literal_accessor_ty() {
|
||||
infer_eq(".0", "( a )* -> a");
|
||||
infer_eq(".4", "( _, _, _, _, a )* -> a");
|
||||
infer_eq(".5", "( ... 5 omitted, a )* -> a");
|
||||
infer_eq(".200", "( ... 200 omitted, a )* -> a");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn record_arg() {
|
||||
infer_eq("\\rec -> rec.x", "{ x : a }* -> a");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue