Merge pull request #4359 from roc-lang/i4313

Disallow typing optional fields when required fields are annotated
This commit is contained in:
Folkert de Vries 2022-10-23 01:20:55 +02:00 committed by GitHub
commit be624f8bcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 133 additions and 85 deletions

View file

@ -1209,7 +1209,7 @@ fn can_assigned_fields<'a>(
);
let label = Lowercase::from(field_name.value);
field_types.insert(label.clone(), Required(field_type));
field_types.insert(label.clone(), RigidRequired(field_type));
break 'inner label;
}
@ -1246,7 +1246,7 @@ fn can_assigned_fields<'a>(
}
};
field_types.insert(field_name.clone(), Required(field_type));
field_types.insert(field_name.clone(), RigidRequired(field_type));
break 'inner field_name;
}