Closed XPhyro closed 1 year ago
Hi, thanks for the PR. Sorry for the extremely late response, somehow I never got a notification about this.
I'm not able to reproduce a warning with the official Godot 3.5 binaries. I tried on Windows, macOS, and a fresh install of Fedora Linux 36 - all using the .NET 6 SDK.
I'm no C# expert, but in general there shouldn't be warnings about normal, documented, non-deprecated code, so I don't like to suppress warnings except as a last resort.
Hi, thanks for the PR. Sorry for the extremely late response, somehow I never got a notification about this.
No worries.
I'm not able to reproduce a warning with the official Godot 3.5 binaries. I tried on Windows, macOS, and a fresh install of Fedora Linux 36 - all using the .NET 6 SDK.
Might be fixed in 3.5, not sure. For context, at the time, I used Godot 3.4 & Godot 4 (compiled from git master) on Arch Linux.
I'm no C# expert, but in general there shouldn't be warnings about normal, documented, non-deprecated code, so I don't like to suppress warnings except as a last resort.
At the time, on my system, the compiler produced CS0649 for any variable marked with [Export]
and not set. I didn't think it was a great idea to have a dummy assignment, so opted for suppression.
Godot 3.5 might be doing something for this similar to Unity's special treatment for [SerializeField]
variables.
I tested a little more and found that removing the "= null" causes that warning. But explicitly assigning null is enough to remove the warning, so I think the current code is correct. The compiler doesn't report any issues even with all warnings turned on (level 9999).
I tested a little more and found that removing the "= null" causes that warning.
Oh yeah, it already has an assignment. I must have accidentally removed it.
At the time, on my system, the compiler produced CS0649 for any variable marked with [Export] and not set.
Also I didn't know in-place assignments suppressed this warning.
Sorry about the hassle overall.
When building the game, the C# compiler complains about CS0649. As I see it, the font is expected to be assigned in the Godot editor, not via code, so this should be made clear to the compiler.