-
-
Notifications
You must be signed in to change notification settings - Fork 23.8k
Use ScriptExportMode enum in EditorExportPreset #107167
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
Use ScriptExportMode enum in EditorExportPreset #107167
Conversation
9fe074c to
a288fc8
Compare
| } | ||
|
|
||
| int script_export_mode = current->get_script_export_mode(); | ||
| int script_export_mode = int(current->get_script_export_mode()); |
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.
I don't think this is necessary but...?
a288fc8 to
edab528
Compare
33d250d to
51da650
Compare
fac28f3 to
f7fe7ef
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.
Does changing from int to enum actually break binary compatibility? Seems to me that the FFI representation should be the same 🤔
Or is this a shortcoming of the compatibility mechanism, which treats enum and int as different?
(Obviously it does break source compatibility in situations where GDExtension bindings generate strongly typed enums, but the compatibility is mostly to allow 4.2 extensions to run under 4.4, which should be possible without registering a compatibility method.)
It does for the C# bindings. And the compatibility method would not prevent it, because C# does not allow overloads on the return type. |
f7fe7ef to
36c701b
Compare
36c701b to
72c04aa
Compare
|
Rebased. |
72c04aa to
4ad3581
Compare
Repiteo
left a comment
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.
I think compatibility breakage in this scenario is warranted, but hearing some second opinions would be nice
01f5e90 to
58d36fe
Compare
|
Reminds me of #108559 The breakage is only relevant when someone had used the method, no? It seems very niche, it's likely fine to change it. |
aaronfranke
left a comment
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.
As long as the compatibility breakage is deemed acceptable, I approve of this.
dalexeev
left a comment
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 is a fairly small change, which amusingly requires quite a bit of boilerplate (but is still valid and worth noting). I don't think many users were concerned about the method returning int instead of ScriptExportMode, much less be affected by this change.
In terms of compatibility, in GDScript int is compatible with any enum, so narrowing the return value of a non-virtual method should be safe.
|
That's a healthy enough sample size to move forward with a merge (after rebase) |
58d36fe to
f662e28
Compare
|
Rebased. |
f662e28 to
3b1a62f
Compare
|
Needs another rebase. The fast-moving compat file is annoying. |
Maybe we should reorganize it, it's a constant waste of time since it's always required in applying both changes, and there's no real conflicts to resolve. If it is one file per-PR it should not cause conflicts: like |
3b1a62f to
14ede94
Compare
|
Thanks! |
While making #107143 I discovered that for some ungodly reason EditorExportPreset's
get_script_export_modehas been exposed to return an integer, not a value from ScriptExportMode, which was exposed for this exact, singular purpose. This PR fixes that.This probably breaks compatibility and I am not sure who can review this. Does it count as a fix or an enhancement?