Replies: 1 comment 3 replies
-
How did you confirm it was read-only? Can you show your code? Edit: Can confirm with general read-only cases, both references to This is specifically because of this code: Which uses the same return, unsure how this could be easily fixed without re-writing a bunch of stuff here, but will take a look when I can |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I got interesting error message when I was trying to change element of read_only (implicitly casted from const) array.
It does tell me that I did "Invalid set on index[X]". This message is the same as if you try to access index that is out of range which can be confusing.
Is there any reason not to explicitly state that user tried to access array index that is bigger than array size - 1 or that element he tried to change belongs to array that is declared as read only?
It took me a while to find out what's wrong as I was doing some meta shenanigans, playing with array types. Since I encountered issue like this, I thought that maybe other people could be on the same boat and this can be improved, giving more clarity, information to fix small bugs like his.
Beta Was this translation helpful? Give feedback.
All reactions