-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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 some DEFVALs to use the right type #84906
Conversation
b05c2d9
to
11831fe
Compare
11831fe
to
d3b0b93
Compare
d3b0b93
to
c25ca85
Compare
For the remaining two extension validation errors, you need to add compatibility methods so that the old hashes are preserved:
|
I find it odd that it's complaining about a hash change only in those methods though, I only changed the default value of a StringName parameter like in all the other methods. |
Could be because all other methods have a register hash in |
Yeah that's weird. Maybe the check aborts too early with the error and doesn't list the other missing hashes. If so fixing those two might unlock the next batch of errors? CC @RedworkDE Edit: Or what AThousandShips wrote. |
d8e6168
to
9095b3f
Compare
I think this may actually be a significant issue with the compat hashes approach, as we may not do proper validation that the new hashes do match the methods we currently provide, and thus we might be missing errors. The hashes for all methods that changed default argument values here are probably wrong in that file and would need to be fixed, or those compat hashes would be pointing at non-existing hashes. And thus all methods modified here possibly need compat methods registered anyway, even if the checks are not complaining. CC @dsnopek |
I just posted PR #84973 which aims to expose issues where the mapped hash from |
Would be good to rebase this PR on #84973 so we can confirm whether that's the problem and if it will highlight it properly. |
9095b3f
to
61e167a
Compare
74c466d
to
7ab23ee
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.
This seems fine to me!
Assuming I'm understanding correctly, the only "true" compatibility breakage is from where a Variant
default changes from 0
to null
, which is only on CodeEdit::add_code_completion_option()
. That seems acceptable to me.
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.
Needs to be moved to the 4.2 file now that it exists
Nothing urgent, but would be good to revisit this sooner than later for the 4.3 cycle. |
2c36e2c
to
2384c03
Compare
@dsnopek the compat hashes are all out of date, how to update them/add them? |
I don't know if David had a handy script to do this, but I suppose the manual way would be to compile this PR, generate the extension API, and copy paste the new hashes from that JSON in place of the ones in |
While I used a script to generate them originally, I don't have a script to update them. How many hashes in The mapping in Although, looking back at this now: why can't we just add normal compatibility methods for this? In the cases where the only thing that changes is the |
- Use `StringName()` in DEFVAL for StringNames. - Use `Variant()` in DEFVAL for Variants.
2384c03
to
5ba92e5
Compare
Thanks! |
Change some default parameter values to use the right type, this affects how they are exposed in
extension_api.json
as well as the generated C# bindings.DEFVAL(StringName())
will be written as&""
as opposed to""
(which is used for String).DEFVAL(Variant())
will be written asnull
.DEFVAL(Variant::NIL)
is incorrect since that's an enum and will result in0
as the written value. This change probably breaks behavior compatibility so I'm adding the label.