-
Notifications
You must be signed in to change notification settings - Fork 161
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
Support metatables for GoStruct #74
Comments
Sounds reasonable. Care to make a PR? |
My original idea was quite incorrect: metatable on metatable won't work as I expected. But I managed to implement it another way. Pull request: #78 I added a function SetMetaTableForGoStruct(), implemented via The The Tested in TestGoStructMetatable(), seems to work. 😃 |
Sorry, there is a bug with this solution. |
Well, I fixed it. |
I'm trying to set a metatable to a GoStruct object to be able calling methods in the manner like obj:Foo().
Currently, testudata() doesn't allow me to do this, requiring the object metatable to be MT_GOINTERFACE or MT_GOFUNCTION.
I understand the idea of this check, and suggest extending it in the following manner:
In addition, the setmetatable() call should be modified (as following), or a new function (e.g. SetGoStructMetaTable) may be introduced if you find this way more appropriate.
The text was updated successfully, but these errors were encountered: