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

Indexing new vectors with non-constant keys is broken #1521

Closed
memcorrupt opened this issue Nov 10, 2024 · 3 comments · Fixed by #1541
Closed

Indexing new vectors with non-constant keys is broken #1521

memcorrupt opened this issue Nov 10, 2024 · 3 comments · Fixed by #1541
Assignees
Labels
bug Something isn't working

Comments

@memcorrupt
Copy link

Example:

b="X"print(vector.create(1,2,3)[b])

Error: attempt to index vector with 'X'


Seems to be caused due to vector indexing only being handled in LOP_GETTABLEKS.

@memcorrupt memcorrupt added the bug Something isn't working label Nov 10, 2024
@vegorov-rbx
Copy link
Collaborator

This is caused my missing __index method in the vector metatable.

@vegorov-rbx vegorov-rbx self-assigned this Nov 18, 2024
@vegorov-rbx
Copy link
Collaborator

We have a fix ready which is likely to be included in the next sync/release.

@memcorrupt
Copy link
Author

We have a fix ready which is likely to be included in the next sync/release.

Thanks!

ayoungbloodrbx added a commit that referenced this issue Nov 22, 2024
## What's Changed?

* Optimized the vector dot product by up to 24%
* Allow for x/y/z/X/Y/Z vector field access by registering a `vector`
metatable
with an `__index` method (Fixes #1521)
* Fixed a bug preventing consistent recovery from parse errors in table
types.
* Optimized `k*n` and `k+n` when types are known
* Allow fragment autocomplete to handle cases like the automatic
insertion of
parens, keywords, strings, etc., while maintaining a correct relative
positioning

### New Solver

* Allow for `nil` assignment to tables and classes with indexers

---------

Co-authored-by: Aaron Weiss <aaronweiss@roblox.com>
Co-authored-by: Andy Friesen <afriesen@roblox.com>
Co-authored-by: Aviral Goel <agoel@roblox.com>
Co-authored-by: Hunter Goldstein <hgoldstein@roblox.com>
Co-authored-by: Varun Saini <vsaini@roblox.com>
Co-authored-by: Vighnesh Vijay <vvijay@roblox.com>
Co-authored-by: Vyacheslav Egorov <vegorov@roblox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants