4 ms·
What bugs me is the too-strong coupling between the language and the run-time environment. (Non-)nullable references are a perfect example. They could have bee
by branko_d 7y ago
What bugs me is the too-strong coupling between the language and the run-time environment.
(Non-)nullable references are a perfect example. They could have been supported on the old .NET Framework, but MS chose to only officially support them under .NET Core (will be .NET 5 soon).
I have a library that is used in both "legacy" (.NET Framework, never to be ported to .NET Core) and "new" (.NET Core or soon-to-be .NET Core) projects. It makes perfect sense to annotate it for nullability and it doesn't need any of the other C# 8 features that depend on .NET Core. But I can't (officially) do it, even though Mads Torgersen himself wrote:
https://devblogs.microsoft.com/dotnet/embracing-nullable-reference-types/ https://devblogs.microsoft.com/dotnet/embracing-nullable-ref...
You also have to set the language version to C# 8.0, of course, and that is not a supported scenario when one of the target versions is below .NET Core 3.0. However, you can still do it manually in your project settings, and unlike many C# 8.0 features, the NRT feature specifically happens to not depend on specific elements of .NET Core 3.1.
- Mindless2112 7y agoFeel free to express your support at [1]. Although I'm not very optimistic that NRT in 7.x will happen, more support would help. [1] https://github.com/dotnet/csharplang/issues/2995 https://github.com/dotnet/csharplang/issues/2995