-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Change GDScriptDataType container_element_type
to vector container
#81662
Conversation
ad46294
to
d283835
Compare
Decision made at the GDScript Team Meeting that we want this PR to make it for 4.2, even if there's nothing front-facing to a user, will take time to review it this week. This PR will facilitate future development of typed dictionaries. |
d283835
to
6fffeae
Compare
cbbedc0
to
35adb70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall, just a couple of nitpicks.
d90e809
to
5b1e3fb
Compare
5b1e3fb
to
9b6fd54
Compare
812f355
to
67e8d72
Compare
67e8d72
to
f9fd2a7
Compare
f9fd2a7
to
72ed52d
Compare
Haven't seen/heard anything to the contrary, so the containers are now changed to be public & not use pointers. This certainly simplified the code, with several areas being made redundant in the process & cleaned up as a result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Regarding the pointer, as the comment said it was for memory management. I didn't to construct and copy an empty container type every time, since it's more likely that it does not exist. Being a pointer it can be set only when needed, which is also why it was private. With a vector this is less of a concern because the vector can be empty. |
container_element_type
to vector containercontainer_element_type
to vector container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved during the GDScript meeting, just have to apply the suggestions by @dalexeev. Thanks!
72ed52d
to
5cf0d77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Repiteo !
Thanks! |
Gonna start extracting bits from my typed dictionary PR (#78656) so the changes can be integrated more smoothly, starting with changing
container_element_type
from a pointer to a vector of pointers. This allows support for multiple types in the container syntax, without drastically overhauling the current implementationsWhile mostly superfluous in our current context of only having typed arrays, this will allow other type collections (eg: dictionaries) to be integrated straight away without needing to change the existing system. It also adds support for highlighting all container elements as types, and will recognize if a container is over/under capacity (only for arrays atm, will specify it requires exactly one type)