Skip to content

Clarify Duplicate Declaration error #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 15, 2024

Conversation

eemeli
Copy link
Collaborator

@eemeli eemeli commented Jan 5, 2024

During implementation, I noticed that while we included this in the variable mutability design doc:

References to later declarations are not allowed,
so this is considered an error:
```
local $foo = {$bar :number}
local $bar = {42 :number}
{The answer is {$foo}}
```

we missed out on accounting for that in #488. So this PR adds a Forward Reference data model error for that situation. We might also want to consider this Duplicate Declaration error as a Forward Reference error instead:

- A _local-declaration_ MUST NOT bind a _variable_ that appears in its _expression_.

@eemeli eemeli added specification Issue affects the specification LDML45 LDML45 Release (Tech Preview) labels Jan 5, 2024
@eemeli eemeli changed the title Add missing Forward Reference data model error Clarify Duplicate Declaration error Jan 15, 2024
@eemeli
Copy link
Collaborator Author

eemeli commented Jan 15, 2024

I've refactored the PR to not add a new error, and instead clarify the existing Duplicate Declaration error to cover this case as well.

@eemeli eemeli requested review from aphillips, stasm and mihnita January 15, 2024 12:35
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.

Thanks for this. Minor tweaks suggested.

Co-authored-by: Addison Phillips <addisonI18N@gmail.com>
@eemeli eemeli requested a review from aphillips January 15, 2024 15:13
@eemeli
Copy link
Collaborator Author

eemeli commented Jan 15, 2024

@aphillips I've resolved the conflicts, and this should now merge cleanly.

@aphillips aphillips merged commit 258d49a into unicode-org:main Jan 15, 2024
@eemeli eemeli deleted the forward-reference-error branch January 15, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LDML45 LDML45 Release (Tech Preview) specification Issue affects the specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants