mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Compile derived structural equality
This commit is contained in:
parent
54e977be2d
commit
3674f6861e
7 changed files with 41 additions and 1 deletions
|
@ -99,6 +99,17 @@ impl Symbol {
|
|||
DERIVABLE_ABILITIES.iter().find(|(name, _)| *name == self)
|
||||
}
|
||||
|
||||
/// A symbol that should never be exposed to userspace, but needs to be exposed
|
||||
/// to compiled modules for deriving abilities for structural types.
|
||||
pub fn is_exposed_for_builtin_derivers(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
// The `structuralEq` call used deriving structural equality, which will wrap the `Eq`
|
||||
// low-level implementation.
|
||||
&Self::EQ_STRUCTURAL_EQ
|
||||
) && false
|
||||
}
|
||||
|
||||
pub fn module_string<'a>(&self, interns: &'a Interns) -> &'a ModuleName {
|
||||
interns
|
||||
.module_ids
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue