mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Add support for hash key of tuples
This commit is contained in:
parent
f4f9ae7a5d
commit
e6cac71ca5
3 changed files with 16 additions and 3 deletions
|
@ -30,6 +30,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::Tuple(_fields) => todo!(),
|
||||
FlatHashKey::TagUnion(tags) => {
|
||||
if tags.len() == 1 {
|
||||
hash_newtype_tag_union(env, def_symbol, tags.into_iter().next().unwrap())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue