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

fix(callable): __call cannot be in a nested metatable #489

Merged
merged 2 commits into from
Nov 7, 2024
Merged

Conversation

Tieske
Copy link
Member

@Tieske Tieske commented Nov 5, 2024

if a metatable doesn't itself have a __call function, but gets one through another metatable, then the original object is NOT callable. Lua will query the metatable using rawget, and hence will not return the nested __call function

Reported by @tmillr here

@alerque
Copy link
Member

alerque commented Nov 6, 2024

Is this true for all relevant versions of the Lua VM?

@Tieske
Copy link
Member Author

Tieske commented Nov 6, 2024

@alerque I updated the test by actually calling it to verify it is non-callable. Passes on all the engines.

@Tieske Tieske merged commit d2dc61b into master Nov 7, 2024
16 of 18 checks passed
@Tieske Tieske deleted the fix/callable branch November 7, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants