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

Teal does not seem to support __index #541

Closed
makspll opened this issue Aug 2, 2022 · 3 comments
Closed

Teal does not seem to support __index #541

makspll opened this issue Aug 2, 2022 · 3 comments
Labels
feature request New feature or request

Comments

@makspll
Copy link

makspll commented Aug 2, 2022

Having a custom __index metamethod:

 metamethod __index: function(LuaVec<T>,integer):(ReflectedValue)

does not allow me to index my type with integers,

is this intended? It's very much annoying to work around

@hishamhm
Copy link
Member

hishamhm commented Aug 2, 2022

is this intended?

No, it's just not implemented! Patches are definitely welcome!

@hishamhm hishamhm added the feature request New feature or request label Aug 2, 2022
@hishamhm
Copy link
Member

hishamhm commented Aug 4, 2022

I just committed some initial support! For now, only functions as __index are handled and it only resolves __index when using t[x] (not with t.k or t:k). But it should address these "vector-like" use-cases already.

@makspll
Copy link
Author

makspll commented Aug 4, 2022

that's perfect, thank you!

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

No branches or pull requests

2 participants