Get the correct buitlin to derive from symbol name

This commit is contained in:
Ayaz Hafiz 2022-08-03 15:02:46 -05:00
parent ab3ff6e842
commit 1526581542
No known key found for this signature in database
GPG Key ID: 0E2A37416A25EF58

View File

@ -5238,11 +5238,12 @@ fn late_resolve_ability_specialization<'a>(
Resolved::Specialization(symbol) => symbol,
Resolved::NeedsGenerated(var) => {
let derive_key = roc_derive_key::Derived::builtin(
roc_derive_key::DeriveBuiltin::Decoder,
member.try_into().expect("derived symbols must be builtins"),
env.subs,
var,
)
.expect("not a builtin");
.expect("specialization var not derivable!");
match derive_key {
roc_derive_key::Derived::Immediate(imm) => {
// The immediate is an ability member itself, so it must be resolved!