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

Fixes GDScript define nested dictionary and array as constants #59613

Merged
merged 1 commit into from
Apr 27, 2022

Conversation

PastMoments
Copy link
Contributor

@PastMoments PastMoments commented Mar 28, 2022

Fixes #50285, note the regression was introduced in (#41983) (commit 3886a2f)

This issue seems to have been caused by the logic for checking const of elements being moved from reduce_array to const_fold_array (and reduce_dict to const_fold_dict) by the regression. Thus reduce_expression was not properly assigning const to these types.

This PR just adds extra checks in const_fold_array and const_fold_dict to handle nested arrays/dicts.

@PastMoments PastMoments requested a review from a team as a code owner March 28, 2022 02:14
@Chaosus Chaosus added this to the 4.0 milestone Mar 28, 2022
@akien-mga
Copy link
Member

This seems to make a number of GDScript tests fail, and eventually crash: https://github.com/godotengine/godot/runs/5714947096?check_suite_focus=true

@PastMoments
Copy link
Contributor Author

PastMoments commented Apr 13, 2022

I've force pushed a new fix, and also added tests for the issue.
Tests seem to pass when I run locally (sorry I didn't do it properly the first time.)

@vnen
Copy link
Member

vnen commented Apr 18, 2022

Overall looks okay to me, despite my comment. This needs a rebase to remove the merge commit though (see https://docs.godotengine.org/en/stable/community/contributing/pr_workflow.html#the-interactive-rebase).

@PastMoments
Copy link
Contributor Author

@vnen Resolved the comment and rebased.

@akien-mga akien-mga merged commit 3dd550e into godotengine:master Apr 27, 2022
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

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.

GDScript 2.0: Can't define nested dictionary and array constants
4 participants