Skip to content

Clarify that Duplicate Option Name is a data model error#577

Merged
aphillips merged 4 commits intounicode-org:mainfrom
eemeli:duplicate-option-error
Jan 15, 2024
Merged

Clarify that Duplicate Option Name is a data model error#577
aphillips merged 4 commits intounicode-org:mainfrom
eemeli:duplicate-option-error

Conversation

@eemeli
Copy link
Collaborator

@eemeli eemeli commented Jan 1, 2024

I noticed during implementation that even though we define Duplicate Option Name as a data model error, we handle it as a formatting error. This should be clarified.

@eemeli eemeli added the specification Issue affects the specification label Jan 1, 2024
Copy link
Member

@aphillips aphillips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call out, I think. Some comments.

Comment on lines -217 to -218
- If the _option_'s _identifier_ already exists in the resolved mapping of _options_,
emit a Duplicate Option Name error.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this? An implementation might detect this during parsing (which, it sounds like, you're doing when populating the data model). But it might not (if it naively parses the message and doesn't evaluate options until formatting time). Does this directive do any harm?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we don't do that for any of the data model errors, and keeping this here would create a requirement for throwing data model errors during formatting, rather than before.

We should probably move the syntax & data model error definitions out of formatting.md into their own doc, and make it clearer that a message must be validated against all of them before formatting.

Co-authored-by: Addison Phillips <addisonI18N@gmail.com>
Good callout

Co-authored-by: Eemeli Aro <eemeli@gmail.com>
@eemeli eemeli requested a review from aphillips January 15, 2024 12:56
@aphillips aphillips merged commit e924cc1 into unicode-org:main Jan 15, 2024
@eemeli eemeli deleted the duplicate-option-error branch January 15, 2024 20:40
@eemeli eemeli added this to the LDML 45 milestone Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

specification Issue affects the specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants