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

gdextension: Object::ConnectFlags marked as not a bitfield in extension_api.json #97042

Open
fpdotmonkey opened this issue Sep 15, 2024 · 2 comments

Comments

@fpdotmonkey
Copy link

fpdotmonkey commented Sep 15, 2024

Tested versions

  • Reproducible in: 4.3.stable.official.77dcf97d8

System information

Godot v4.3.stable - Ubuntu 24.04.1 LTS 24.04 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX Vega M GH Graphics (RADV VEGAM) - Intel(R) Core(TM) i7-8809G CPU @ 3.10GHz (8 Threads)

Issue description

In extension_api.json, Object::ConnectFlags is marked as "is_bitfield": false, however, given that the enum values are powers of two, the default value in e.g. Signal::connect is 0 (seemingly unset), and that the behaviors associated with each enum variant are seemingly orthogonal, it would seem that this is a bitfield.

This seems to have led to issues in C# (#74829) and in Rust gdext (godot-rust/gdext#756).

Steps to reproduce

godot --dump-extension-api
cat extension_api.json | jq '.classes[] | select(.name == "Object").enums[] | select(.name == "ConnectFlags").is_bitfield'
# false
# alternately, inspect with a pager or text editor

Minimal reproduction project (MRP)

N/A

@AThousandShips
Copy link
Member

AThousandShips commented Sep 15, 2024

I suspect this might be a limitation to what you can bind in Object as it is so very fundamental, but might be an oversight

Was originally implemented in:

But wasn't mentioned there, so might have been overlooked

@fpdotmonkey
Copy link
Author

fpdotmonkey commented Sep 18, 2024

If it's an oversight, should it be fixed in Godot or worked around by gdextension implementations? Would fixing it be a compatibility break?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants