Have FunctionOrTagUnion include multiple possible tags

This commit is contained in:
Ayaz Hafiz 2022-10-03 11:01:16 -05:00
parent 797763b5fa
commit 61cf8e53e6
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
9 changed files with 155 additions and 85 deletions

View file

@ -2299,10 +2299,11 @@ fn type_to_variable<'a>(
unreachable!("we assert that the ext var is empty; otherwise we'd already know it was a tag union!");
}
let slice = SubsIndex::new(subs.tag_names.len() as u32);
subs.tag_names.push(tag_name.clone());
let tag_names = SubsSlice::extend_new(&mut subs.tag_names, [tag_name.clone()]);
let symbols = SubsSlice::extend_new(&mut subs.closure_names, [*symbol]);
let content = Content::Structure(FlatType::FunctionOrTagUnion(slice, *symbol, ext));
let content =
Content::Structure(FlatType::FunctionOrTagUnion(tag_names, symbols, ext));
register_with_known_var(subs, destination, rank, pools, content)
}