mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-19 01:59:48 +00:00
Treat numbers as ad-hoc types for the purpose of checking ability obligations
This commit is contained in:
parent
568e8d9475
commit
7b23077265
3 changed files with 37 additions and 29 deletions
|
@ -2233,7 +2233,10 @@ fn make_specialization_decision(subs: &Subs, var: Variable) -> SpecializeDecisio
|
|||
use Content::*;
|
||||
use SpecializationTypeKey::*;
|
||||
match subs.get_content_without_compacting(var) {
|
||||
Structure(_) | Alias(_, _, _, AliasKind::Structural) => {
|
||||
Alias(opaque, _, _, AliasKind::Opaque) if opaque.module_id() != ModuleId::NUM => {
|
||||
SpecializeDecision::Specialize(Opaque(*opaque))
|
||||
}
|
||||
Structure(_) | Alias(_, _, _, _) => {
|
||||
// This is a structural type, find the name of the derived ability function it
|
||||
// should use.
|
||||
match roc_derive_key::Derived::encoding(subs, var) {
|
||||
|
@ -2258,7 +2261,6 @@ fn make_specialization_decision(subs: &Subs, var: Variable) -> SpecializeDecisio
|
|||
}
|
||||
}
|
||||
}
|
||||
Alias(opaque, _, _, AliasKind::Opaque) => SpecializeDecision::Specialize(Opaque(*opaque)),
|
||||
Error => SpecializeDecision::Drop,
|
||||
FlexAbleVar(_, _)
|
||||
| RigidAbleVar(..)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue