Add a notion of "openness" tag extensions suitable only for size-polymorphism

This commit is contained in:
Ayaz Hafiz 2023-01-12 17:17:53 -06:00
parent 5f5d6a42d1
commit 1c93727822
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
18 changed files with 302 additions and 233 deletions

View file

@ -14,7 +14,7 @@ use roc_module::symbol::Symbol;
use roc_region::all::{Loc, Region};
use roc_types::subs::{
Content, ExhaustiveMark, FlatType, GetSubsSlice, LambdaSet, OptVariable, RecordFields,
RedundantMark, SubsSlice, UnionLambdas, UnionTags, Variable, VariableSubsSlice,
RedundantMark, SubsSlice, TagExt, UnionLambdas, UnionTags, Variable, VariableSubsSlice,
};
use roc_types::types::RecordField;
@ -67,7 +67,10 @@ pub(crate) fn derive_to_encoder(
let union_tags = UnionTags::insert_slices_into_subs(env.subs, flex_tag_labels);
let tag_union_var = synth_var(
env.subs,
Content::Structure(FlatType::TagUnion(union_tags, Variable::EMPTY_TAG_UNION)),
Content::Structure(FlatType::TagUnion(
union_tags,
TagExt::Any(Variable::EMPTY_TAG_UNION),
)),
);
to_encoder_tag_union(env, tag_union_var, union_tags, def_symbol)