-
Notifications
You must be signed in to change notification settings - Fork 23
upvalues in global functions to local variables not restored properly #29
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
Comments
as mentioned in my last comment on the OC bug report, I also want to add that: This isn't an issue with all local values captured in global functions |
I'm testing this with eris and the bug is not repro'ing |
This still appears to be an eris issue to me, but i did test this in "eeprom" (sangar will understand) and it DOES NOT repro. There is a lot more loading (i.e. lua's |
@payonel Do you have a workaround for it? |
When investigating a bug report of OpenComputers I found that some lua code can behave incorrectly between loads (restoring the world after closing it)
MightyPirates/OpenComputers#2598
The summary of the problem is:
The issue appears to be that local values captured (upvalue) in global functions do not restore the same reference, the local scope gets a new object, and the global function has its own. It's like its own global upvalue. In fact, all global functions share the same upvalue, and all local functions share the same upvalue, those being 2 separate upvalues.
Here is a simple repro
The text was updated successfully, but these errors were encountered: