-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Fix various issues when function argument's default value is array/dictionary #62994
base: master
Are you sure you want to change the base?
Conversation
5efe44b
to
060b989
Compare
This issue should be easier to spot after the #62934 merge. The gdscript documentation in the current master does not show any default values for parameters at all |
Ok I see the issue now, but there is an issue with this fix. It marks the Array/Dictionary parameter nodes as constant (when possible), which triggers a problem since consts are shared: func fn(x = [1, 2, 3], y = [1, 2, 3]):
x.append(4)
y.append(5)
print(x)
print(y) On master:
This PR:
The existing line Before that happens, I guess for this issue the editor could display the |
060b989
to
1051f5b
Compare
d87aa1d
to
1051f5b
Compare
Thanks for your test and suggestion, I have now updated this PR and it should resolve the issue you found |
c7afc96
to
fef4c2b
Compare
68eef84
to
c21a5c9
Compare
Needs rebase to fix CI due to a temporary godot-cpp issue. |
c21a5c9
to
052cfb1
Compare
Rebased to fix CI issue |
9f1a584
to
f26104f
Compare
f26104f
to
f7b3730
Compare
f7b3730
to
94d6456
Compare
Needs a rebase after other GDScript changes. I checked and the issue is still reproducible, so the changes here are likely still needed. Not critical for 4.0 since we're at RC stage and it's a minor issue, but would be good to review/merge for 4.1 (and then we could cherrypick it for 4.0.x). |
Will push the milestone to 4.2. The GDScript team did not review the PR, but I think it would be nice to in the next weeks, after the 4.1 release. |
This is not a critical bug and a fairly complex problem. It might be better to refactor expression reduction and remove |
In the current version, if the default value of a GDScript function arguments is set to an array or dictionary, it will be null in tooltips and documentation. This PR fixes this issue.
Fix #63018
It also probably fixes some other array and dictionary related issues, but I couldn't find it. Hope someone can test it