Closed Smurf-IV closed 4 months ago
Making the project 'nullable' should help with this
As part of this merge https://github.com/Krypton-Suite/Standard-Toolkit/pull/933
The [AllowNull]
able attribute is now backward compatible with previous frameworks.
This will fix most of the following warnings in the compile:
Reminder!!!!! This should ought to be part of the extended toolkit as well ;)
@Smurf-IV Disable CS0436
?
The following should be preventing it from appearing in anything above core 3.1:
#if NETFRAMEWORK || NETCOREAPP
????
@Smurf-IV Disable
CS0436
?
I'll check what Frameworks I have installed; to make sure it is just the supported list ;-)
Seems to be okay, I do not get the following
@Smurf-IV Disable
CS0436
?
@Wagnerp Why is there still netcoreapp3.1 in the Krypton support list ?
@Smurf-IV Disable
CS0436
?
This was caused by the following code
I'll fix it. (No idea why it was not showing up until I did a full rebuild !!
@Wagnerp Why is there still netcoreapp3.1 in the Krypton support list ?
@Smurf-IV I'll remove it in the next PR
Oh, wow.. This is turning into a big PR..
Following all the nullable
entries around the code is also "catching / pointing out" some unexpected locations where things could/will have gone awry.
Changed All Standard toolkit projects to be
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<WarningLevel>6</WarningLevel>
<Optimize>True</Optimize>
for release style builds (i.e. nightly, canary, as well as normal release) null
and set there type to be nullable, e.g.
??=
or ??
conditionsFirstOrDefault
to perform a return or var set.?.
usagesNote: The warnings and the enablement of these "Nullable" items will be ongoing, as other Features and Bugs are being worked on.
This may appear to be "dragging on" But even this past week MS are still pushing PR's into WinForms that are dealing with nullables ;-) https://learn.microsoft.com/en-us/dotnet/desktop/winforms/whats-new/net80?view=netdesktop-6.0#miscellaneous-improvements
Part of the improvements in .net 6 / 7:
from here: https://github.com/dotnet/winforms/commit/48616c47095149309b95caea9cc4e7c182313756