I've hit a really bizarre error; my code has no coroutines, but it fails with "attempt to yield from outside a coroutine"
I've simplified it down as much as I could; while removing unrelated cruft (e.g. the sort
function from my new project template that I wasn't actually using anywhere) the bug would arbitrarily appear or disappear.
The bug will either get triggered 100% of the time or 0% of the time when you run the cart, but its presence or disappearance arbitrarily changes depending on what other unrelated code there is in the cart.
For example, tab 0 is 15K of function foo() end
repeated over and over again. They're commented out right now, and the bug is present. If you comment them back in, the bug disappears.
Commenting out the body of pqb
(which prints many many u64 objects) seems to remove the bug for good (no matter how many foo
s I comment in or out). I'm not too experienced with metatables; I think I may be at fault for something I'm doing inside u64.__tostring
? sometime variation of this code give a slightly differently-formatted error message that jumps me into the middle of my __tostring
method. or maybe printh
is having issues dumping so much text to the console? I dunno
I'm using pico-8 0.2.4 for windows 7.
the more common error screen:
![](/media/27691/buggy_1.png)
the more rare error screen (can be triggered if there are exactly 144 foos in tab 0)
![](/media/27691/buggy_0.png)
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/bimg/pi/pi17.png)
If a flip() occurs in __tostring() called as a metamethod, a similar error will occur.
This flip() includes an implicit one when it takes too much time.
I am not sure if this is a bug or not.
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/27691/dinnerwashingatsunset.gif)
ahh thank you! that seems likely -- I'm doing a bunch of computation without calling flip or ending _draw, and spending a lot of that time printing out things while I compute them. good to know! yeah I dunno if I'd consider it a bug or not... definitely hard to understand the error message at least.
I suppose it's still odd that the presence/absence of foo
s will consistently trigger or not trigger the bug
[Please log in to post a comment]