Remove TagName in favor of explicit TagName or Closure

Note that we still need a `TagOrClosure` enum for phases past mono, but
at least we get rid of the branches in the front end.
This commit is contained in:
Ayaz Hafiz 2022-06-01 16:54:04 -05:00
parent bbc022b2f5
commit bde107da49
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
29 changed files with 841 additions and 704 deletions

View file

@ -5,8 +5,8 @@ use roc_can::{
expr::{AccessorData, ClosureData, Expr, Field, WhenBranch},
};
use roc_types::subs::{
self, AliasVariables, Descriptor, OptVariable, RecordFields, Subs, SubsSlice, UnionTags,
Variable, VariableSubsSlice,
self, AliasVariables, Descriptor, OptVariable, RecordFields, Subs, SubsSlice, UnionLambdas,
UnionTags, Variable, VariableSubsSlice,
};
/// Deep copies the type variables in the type hosted by [`var`] into [`expr`].
@ -542,7 +542,7 @@ fn deep_copy_type_vars<'a>(
}
let new_union_tags =
UnionTags::from_slices(tags.tag_names(), new_variable_slices);
UnionTags::from_slices(tags.labels(), new_variable_slices);
Structure(TagUnion(new_union_tags, new_ext_var))
})
@ -567,7 +567,7 @@ fn deep_copy_type_vars<'a>(
}
let new_union_tags =
UnionTags::from_slices(tags.tag_names(), new_variable_slices);
UnionTags::from_slices(tags.labels(), new_variable_slices);
Structure(RecursiveTagUnion(new_rec_var, new_union_tags, new_ext_var))
})
@ -628,7 +628,7 @@ fn deep_copy_type_vars<'a>(
}
let new_solved =
UnionTags::from_slices(solved.tag_names(), new_variable_slices);
UnionLambdas::from_slices(solved.labels(), new_variable_slices);
LambdaSet(subs::LambdaSet {
solved: new_solved,