Build derive keys for derivable records

This commit is contained in:
Ayaz Hafiz 2022-08-09 09:01:42 -07:00
parent 275391c065
commit aa5e1e6a27
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
5 changed files with 51 additions and 17 deletions

View file

@ -1,3 +1,4 @@
use roc_module::ident::Lowercase;
use roc_types::subs::{Content, Subs, Variable};
use crate::DeriveError;
@ -17,3 +18,15 @@ pub(crate) fn check_empty_ext_var(
}
}
}
pub(crate) fn debug_name_record(fields: &[Lowercase]) -> String {
let mut str = String::from('{');
fields.iter().enumerate().for_each(|(i, f)| {
if i > 0 {
str.push(',');
}
str.push_str(f.as_str());
});
str.push('}');
str
}