Include RigidOptional as optional field

This commit is contained in:
Ayaz Hafiz 2022-08-20 10:11:28 -05:00
parent d016d5eeb9
commit a1d8f8392a
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 6 additions and 3 deletions

View file

@ -11,7 +11,7 @@ use roc_types::num::NumericRange;
use roc_types::subs::{
instantiate_rigids, Content, FlatType, GetSubsSlice, Rank, RecordFields, Subs, Variable,
};
use roc_types::types::{AliasKind, Category, MemberImpl, PatternCategory, RecordField};
use roc_types::types::{AliasKind, Category, MemberImpl, PatternCategory};
use roc_unify::unify::{Env, MustImplementConstraints};
use roc_unify::unify::{MustImplementAbility, Obligated};
@ -840,7 +840,7 @@ impl DerivableVisitor for DeriveDecoding {
fields: RecordFields,
) -> Result<Descend, NotDerivable> {
for (field_name, _, field) in fields.iter_all() {
if matches!(subs[field], RecordField::Optional(..)) {
if subs[field].is_optional() {
return Err(NotDerivable {
var,
context: NotDerivableContext::Decode(NotDerivableDecode::OptionalRecordField(