mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Support newtypes and unit tag union hash deriving
This commit is contained in:
parent
251b3865d9
commit
41c9985c53
2 changed files with 42 additions and 7 deletions
|
@ -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 =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue