Quote from: Crimson Wizard on Thu 12/10/2023 16:10:18Quote from: vga256 on Fri 06/10/2023 18:22:41Oh interesting. It appears this is bug is far less generalized that I had guessed. I'll run through a few different coding scenarios until I figure out which one it can be reproduced with.
Edit: I've tried to replicate this with a new/empty test project with the same kind of code, and I cannot replicate it. Would you mind if I zipped up my project folder and sent it to you via PM? I can point out how to reproduce it using my project.
I managed to replicate this with certain code, but only after I copied lots of your code over (struct definitions, etc). My attempts to replicate this in a smaller environment failed consistently.
This is definitely a compiler's error, but not an obvious one, it fails to track element access correctly at some point, maybe it cannot handle more complicated script.
The new compiler by fernewelten, which we use in ags4, does not have this problem, it points out the scripting mistake.
Using new compiler I found multiple other syntax mistakes in your game's script, so that's not the only issue: non-optional args following optional args (with default value), comparing non-managed object to null, comparing void function return value to an integer, and so on.
Old compiler misses all these for some reason.
Too bad the new compiler has its own problems, where things that were supposed to work with old compiler normally don't work anymore. For instance, it no longer can print char[n] array as a string into String.Format. I might report these as mistakes. But I think there are workarounds for all of these cases.
Interesting! I tried unsuccessfully for hours replicating the issue with identical code (not entire scripts, just structs and definitions), but it seemed like the scripts needed a certain level of complexity before it was triggered. Considering how rare and difficult to reproduce this is, it's probably not worth spending any time on it. I do appreciate that you at least confirmed that I'm not crazy.
Funny - I hadn't even caught the null comparisons - and the void-integer comparisons are definitely typos on my part.
Thanks for your time.