mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Starting to add no arg tag union
This commit is contained in:
parent
b7b04344f3
commit
d34f984169
7 changed files with 492 additions and 330 deletions
|
@ -728,6 +728,25 @@ fn type_to_variable(
|
|||
|
||||
register(subs, rank, pools, content)
|
||||
}
|
||||
FunctionOrTagUnion(tag_name, symbol, ext) => {
|
||||
let mut tag_vars = MutMap::default();
|
||||
|
||||
let temp_ext_var = type_to_variable(subs, rank, pools, cached, ext);
|
||||
let mut ext_tag_vec = Vec::new();
|
||||
let new_ext_var = match roc_types::pretty_print::chase_ext_tag_union(
|
||||
subs,
|
||||
temp_ext_var,
|
||||
&mut ext_tag_vec,
|
||||
) {
|
||||
Ok(()) => Variable::EMPTY_TAG_UNION,
|
||||
Err((new, _)) => new,
|
||||
};
|
||||
tag_vars.extend(ext_tag_vec.into_iter());
|
||||
|
||||
let content = Content::Structure(FlatType::TagUnion(tag_vars, new_ext_var));
|
||||
|
||||
register(subs, rank, pools, content)
|
||||
}
|
||||
RecursiveTagUnion(rec_var, tags, ext) => {
|
||||
let mut tag_vars = MutMap::default();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue