godot-rust / godot-rust/gdext

Detect conflicts with reserved/existing identifiers

Open
#1,287 2 comments 1 reaction 0 assignees View on GitHub
c: register quality-of-life
Dominant language
Rust
Stars
5.2k
Forks
312
Avg merge
12h 59m
Merged PRs (30d)
9

Description

Sometimes, users accidentally choose a name that conflicts with a built-in Godot name, or a registered symbol in a base class. They often cause non-obvious errors at runtime.

We should see if we can turn them into compile-time or startup-time errors. Startup-time is OK, if we don't want macro-hardcoded logic, so it would be forward-compatible to builders and more dynamic registrations. Either way, this would be a big improvement over the status quo.

These conflicts come in many forms:

- [ ] Classes (IIRC already fails to register, not sure about error message)

- [ ] `#[func]` definitions
- [ ] virtual method names (e.g. `_ready`)
- [ ] other functions in the base

- [ ] `#[var]` / `#[export]` properties
- [ ] property of same name exists in the base class
- [ ] or the getters/setters exist as functions

- [ ] `#[signal]`

- [ ] `#[constant]`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.