mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Disallow typing optional fields when required fields are annotated
Closes #4313
This commit is contained in:
parent
62c9a2a8b6
commit
05e8e6de6f
13 changed files with 133 additions and 85 deletions
|
@ -807,7 +807,9 @@ impl Layout {
|
|||
RecordField::Optional(_) | RecordField::RigidOptional(_) => {
|
||||
// do nothing
|
||||
}
|
||||
RecordField::Required(_) | RecordField::Demanded(_) => {
|
||||
RecordField::Required(_)
|
||||
| RecordField::Demanded(_)
|
||||
| RecordField::RigidRequired(_) => {
|
||||
let var = subs.variables[var_index.index as usize];
|
||||
let layout = Layout::from_var_help(layouts, subs, var)?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue