Closed Muchaszewski closed 1 year ago
I've thought about this, there are some difficulties because of how you frequently need to initialize member variables in _EnterTree or _Ready instead of a constructor. I remember seeing some solutions for this discussed in the Chickensoft Discord months ago, I'll see if I can dig that up.
You can mark all of those as nullable, and initialize them with null!
to remove the warning like so:
FontFile Font? {get; init; } = null!;
but usually the ?
is enough, and it doesn't require any further modifications.
I will see if I can do a PR for this tomorrow :)
Yeah, there's one or two things I might want to redesign, but for now I'm just suppressing most warnings with null!
.
Don't worry about a PR, I'll push my fixes today.
Thanks for the report, I'll keep Nullable enabled in the project so I don't break it in the future.
Released in v4.0.4
I like my projects to run with Nullable reference types: Enabled to allow me as a developer to notice obvious issues with nullable types.
Fixing 3-4 issues with the with lack of
?
on some types, it shows 35 warrnings. I would love to have this fixed.It doesn't break anything to use this in your project. It's just ignored when someone has this Disabled (as it is by default)
Example of the warning: