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

EnumList should error when trying to index a nil value within the Enums table #31

Open
bloeo opened this issue Dec 30, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@bloeo
Copy link
Contributor

bloeo commented Dec 30, 2021

I believe this was removed when table.freeze was added, but table.freeze only fulfills what __newindex did. It does not error if you index a nil value.

In my opinion, it is fairly useful for debugging, especially if you are changing around the Enum names around quite a bit. I had to spend 20 mins to debug an issue related to this, and it would be nice if the behavior matched that of the Roblox Enums, which error if you try to index for a non-existent Enum.

@Sleitnick Sleitnick self-assigned this Jan 5, 2022
@Sleitnick Sleitnick added the enhancement New feature or request label Jan 5, 2022
@Sleitnick
Copy link
Owner

I think this should be pretty doable. Might just need to tack on an __index function that throws an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants