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

C# export field Initialization Check #214

Open
molingyu opened this issue Aug 22, 2024 · 1 comment
Open

C# export field Initialization Check #214

molingyu opened this issue Aug 22, 2024 · 1 comment

Comments

@molingyu
Copy link

molingyu commented Aug 22, 2024

version: 242.20224.418

public partial class Test : Node
{
    [Export] public Node ExportNode;
}

For the above code, you will get a warning about null check:

Non-nullable field 'ExportNode' is uninitialized. Consider declaring the field as nullable.

In theory, the fields exported by Godot should not be checked for initialization (initialization is in the corresponding tscn file).

@molingyu
Copy link
Author

By the way, this field will be prompted to be set as a private field. This suggestion should not be applied to exported fields.

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

No branches or pull requests

1 participant