Skip to content

Detect conflicts with reserved/existing identifiers #1287

@Bromeon

Description

@Bromeon

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: registerRegister classes, functions and other symbols to GDScriptquality-of-lifeNo new functionality, but improves ergonomics/internals

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions