godotengine / godotengine/godot

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

Open
#97,042 2 comments 3 reactions 0 assignees View on GitHub
discussion topic:core
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### 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# (https://github.com/godotengine/godot/issues/74829) and in Rust gdext (https://github.com/godot-rust/gdext/issues/756).

### Steps to reproduce

```sh
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

Contributor guide

Open the contributing guide

Research direction

Start by running `godot --dump-extension-api` and inspecting `extension_api.json` for `Object::ConnectFlags`, then trace how its bitfield status is determined. Compare the enum values and generated metadata with the reported C# and Rust gdext issues; done means the generated API reports the correct status and the relevant regression is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.