mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-16 01:50:15 +00:00
Get first inspect for non-Inspect-implementing opaques specialized
This commit is contained in:
parent
c87e3e7413
commit
5c805ce80f
6 changed files with 75 additions and 44 deletions
|
@ -634,8 +634,17 @@ fn make_specialization_decision<P: Phase>(
|
|||
};
|
||||
match abilities_store.get_implementation(impl_key) {
|
||||
None => {
|
||||
// Doesn't specialize; an error will already be reported for this.
|
||||
SpecializeDecision::Drop
|
||||
match ability_member {
|
||||
// Inspect is special - if there is no implementation for the
|
||||
// opaque type, we always emit a default implementation.
|
||||
Symbol::INSPECT_TO_INSPECTOR => SpecializeDecision::Specialize(
|
||||
Immediate(Symbol::INSPECT_OPAQUE),
|
||||
),
|
||||
_ => {
|
||||
// Doesn't specialize; an error will already be reported for this.
|
||||
SpecializeDecision::Drop
|
||||
}
|
||||
}
|
||||
}
|
||||
Some(MemberImpl::Error) => {
|
||||
// TODO: probably not right, we may want to choose a derive decision!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue