Skip to content
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

Show an error warning when a name occurs more than once in the names list of a destructured variable #813

Open
christianp opened this issue Jan 30, 2024 · 3 comments

Comments

@christianp
Copy link
Member

christianp commented Jan 30, 2024

For example, put a,b,a in the name field, and [1,2,3] in the definition field.
When you run the question, an error "There is more than one definition of the variable a." is shown. The editor should show a warning, too. At the moment, it shows both values in the generated value box.

When there's only one variable name in the list, e.g. a,a, the editor does display an error "There's another variable or constant with the name a."

@IsaacJrTypes
Copy link

Hi @christianp, I will be working on this.

@MarkBuster
Copy link

I will also be working on this as part of CodeDay.

@christianp
Copy link
Member Author

It turns out that the editor does show an error if there's only one unique name in the list, so I've edited the issue description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants