Skip to content
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

GDScript: Improve error messages for invalid indexing #66948

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Oct 5, 2022

These errors are very common when using an invalid property name or calling on an object of the wrong type, and the previous message was a bit cryptic for users.

Before

image
image

After

image
image
(was missing quotes in this last one, fixed afterwards)

These errors are very common when using an invalid property name
or calling on an object of the wrong type, and the previous message
was a bit cryptic for users.
@akien-mga akien-mga force-pushed the gdscript-improve-indexing-error branch from 2b069b6 to 6aa9fb8 Compare October 5, 2022 19:10
@akien-mga
Copy link
Member Author

It's not perfect as is as the same code is used when indexing arrays with [i]:
image

I might rework it to be a bit more clever though, it's a bit annoying that indexing basically covers property/member access, dictionary keys (which can be accessed like properties) and array indexing.

@akien-mga
Copy link
Member Author

Marking as draft as I'm not actively working on it now. I'd welcome anyone who wants to take it over and make sure that it gives a meaningful message in all cases.

@akien-mga
Copy link
Member Author

Superseded by #82639.

@akien-mga akien-mga closed this Oct 4, 2023
@AThousandShips AThousandShips removed this from the 4.x milestone Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants