Support newtypes and unit tag union hash deriving

This commit is contained in:
Ayaz Hafiz 2022-10-04 18:11:37 -05:00
parent 251b3865d9
commit 41c9985c53
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 42 additions and 7 deletions

View file

@ -27,13 +27,7 @@ use crate::{synth_var, util::Env, DerivedBody};
pub(crate) fn derive_hash(env: &mut Env<'_>, key: FlatHashKey, def_symbol: Symbol) -> DerivedBody {
let (body_type, body) = match key {
FlatHashKey::Record(fields) => hash_record(env, def_symbol, fields),
FlatHashKey::TagUnion(tags) => {
if tags.len() > 1 {
hash_tag_union(env, def_symbol, tags)
} else {
todo!()
}
}
FlatHashKey::TagUnion(tags) => hash_tag_union(env, def_symbol, tags),
};
let specialization_lambda_sets =