-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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#: Fix GD0107 not applying to arrays and dictionaries containing nodes #94599
C#: Fix GD0107 not applying to arrays and dictionaries containing nodes #94599
Conversation
Thanks for contributing to the .NET module! This makes sense to me, and GDScript already reports an error for exported This PR currently only applies to Also, since you are a new contributor, make sure to read CONTRIBUTING.md and the contributing documentation if you haven't already. Feel free to reach out in the development chat if you need help. |
54c5cdb
to
c5980ba
Compare
Nice catch, thanks! I've added checks for Here's a new resource class to test with: using Godot;
using System;
[GlobalClass]
public partial class AResource : Resource
{
[Export] public ANode3D[] DotnetArrayField;
[Export] public Godot.Collections.Array<ANode3D> GodotArrayField;
[Export] public Godot.Collections.Dictionary<ANode3D, string> GodotDictionaryWithNodeAsKeyField;
[Export] public Godot.Collections.Dictionary<string, ANode3D> GodotDictionaryWithNodeAsValueField;
[Export] public ANode3D[] DotnetArrayProperty { get; set; }
[Export] public Godot.Collections.Array<ANode3D> GodotArrayProperty { get; set; }
[Export] public Godot.Collections.Dictionary<ANode3D, string> GodotDictionaryWithNodeAsKeyProperty { get; set; }
[Export] public Godot.Collections.Dictionary<string, ANode3D> GodotDictionaryWithNodeAsValueProperty { get; set; }
} |
c5980ba
to
d386429
Compare
You'll also need to add tests for the new cases that are expected to report the diagnostic in the ExportDiagnostics_GD0107.cs file. The C# you just shared is pretty close, just need to add |
d386429
to
8812ed6
Compare
...itor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/ExportDiagnostics_GD0107.cs
Outdated
Show resolved
Hide resolved
8812ed6
to
206ff9e
Compare
...itor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/ExportDiagnostics_GD0107.cs
Outdated
Show resolved
Hide resolved
...itor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/ExportDiagnostics_GD0107.cs
Outdated
Show resolved
Hide resolved
206ff9e
to
8aa444d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
Thanks! And congrats for your first merged Godot contribution 🎉 |
Cherry-picked for 4.3.1. |
Fixes #94589.