Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Redot.
Checking the stable version of the documentation...
GD0101: The exported member is static¶
Rule ID |
GD0101 |
Category |
Usage |
Fix is breaking or non-breaking |
Breaking - If the Non-breaking - If the |
Enabled by default |
Yes |
Cause¶
A static member is annotated with the [Export]
attribute. Static members
can't be exported.
Rule description¶
Redot doesn't allow exporting static members.
// Static members can't be exported.
[Export]
public static int InvalidProperty { get; set; }
// Instance members can be exported.
[Export]
public int ValidProperty { get; set; }
How to fix violations¶
To fix a violation of this rule, remove the [Export]
attribute or remove the
static
keyword.
When to suppress warnings¶
Do not suppress a warning from this rule. Static members can't be exported so they will be ignored by Redot, resulting in runtime errors.