Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
keyof - fix LUAU_ASSERT when there's only one key entry (#1388)
Fixes #1387 Was suggested by @alexmccord I changed ``singletons[0]`` to ``singletons.front()``, unsure if that makes a huge difference, and then I added the rest of the things needed for the return type. Maybe it's also the ideal location since doing it before looping through ``keys`` won't add the string into the type arena. I put comments next to it based on how I thought it would make sense. ``LUAU_ASSERT`` seems to trigger when there's only one entry being put inside a UnionType. It's as if it was put there for quality. Allow edits by maintainers is enabled. I tested this with a quick Unit Test something like ```lua local test: keyof<typeof({a="test"})> ```
- Loading branch information