Error on wrong line
-
example().notAsStruct = 2 function example() return 1 // error message appears here without any callStack information // more common scenario (but less clear on what's going on): instance = [ .id = example() .name = "whoops" ]
I think the code snippet above explains best, but to clarify:
When you try to access the property of return value of a function that is not a struct, vector or sprite, you will get the correct error message: "Invalid variable access. (Object must be a struct, vector or sprite)"
However it associates the error with the incorrect line (the return statement of the function in stead of the attempt to access the property of this return statement).
I think the bottom scenario in my code wouldn't be unique, hence I think this is as a bug (I think other people will run into this)
While mentioning it, I'd like to add that it would be helpful to have some call stack information, but in general it's already nice to have clear error messages.
-
Thats a known issue already - but thanks for reporting all the same.
-
Ok, didn't find an existing report of it, good to know that there is awareness :)
Please note that the title may be misleading. Sometimes you get errors on random lines (I've seen that too). This is different from that. This is a specific and reproducible scenario. (I don't think this is the same bug as https://fuzearena.com/forum/topic/204/error-1180137048/2 for example)