mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
better message for duplicate fields/tags
This commit is contained in:
parent
18c6c37c04
commit
7e4a1ef4bd
6 changed files with 367 additions and 52 deletions
|
@ -905,11 +905,12 @@ fn canonicalize_fields<'a>(
|
|||
|
||||
let replaced = can_fields.insert(label.clone(), field);
|
||||
|
||||
if replaced.is_some() {
|
||||
if let Some(old) = replaced {
|
||||
env.problems.push(Problem::DuplicateRecordFieldValue {
|
||||
field_name: label,
|
||||
field_region: loc_field.region,
|
||||
record_region: region,
|
||||
replaced_region: old.region,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue