-
-
Notifications
You must be signed in to change notification settings - Fork 42
feat: add test for construct using unit struct #328
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
Conversation
Ah you've hit an interesting case! Obviously lua doesn't actually have a distinction between maps and lists, which is the root cause here! One way to deal with this would be to introduce a |
Once #329 merges this should work |
Nice! Does the PR need a Rhai test too? |
Yes that would be appreciated |
0ceb264
to
d3af6c1
Compare
Oh never mind, because it's converting to a script value it's getting back to a table in lua, I need to do something else |
Okay, alternatively, we can make hash maps FromScript impl allow lists of tuples as well, that way it will be happy with an empty list |
#332 will definitely do the trick and without |
Pushing this PR up so we can document how to construct unit structs. The first commit of this PR will fail with:
Not sure how to get this to work without passing dummy values like this:
@makspll feel free to push to my PR if you have a fix. Hopefully this test documents this for future users.