mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
use the full alias body to determine the rank
This commit is contained in:
parent
7b4e87a671
commit
e1290835de
1 changed files with 7 additions and 2 deletions
|
@ -1209,14 +1209,19 @@ fn adjust_rank_content(
|
|||
}
|
||||
}
|
||||
|
||||
Alias(_, args, _) => {
|
||||
Alias(_, args, real_var) => {
|
||||
let mut rank = Rank::toplevel();
|
||||
|
||||
// from elm-compiler: THEORY: anything in the real_var would be Rank::toplevel()
|
||||
for (_, var) in args {
|
||||
rank = rank.max(adjust_rank(subs, young_mark, visit_mark, group_rank, var));
|
||||
}
|
||||
|
||||
// from elm-compiler: THEORY: anything in the real_var would be Rank::toplevel()
|
||||
// this theory is not true in Roc! aliases of function types capture the closure var
|
||||
rank = rank.max(adjust_rank(
|
||||
subs, young_mark, visit_mark, group_rank, real_var,
|
||||
));
|
||||
|
||||
rank
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue