Disallow typing optional fields when required fields are annotated

Closes #4313
This commit is contained in:
Ayaz Hafiz 2022-10-18 15:50:20 -05:00
parent 62c9a2a8b6
commit 05e8e6de6f
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
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;
}