manuelroemer / Nullable

A source code only package which allows you to use .NET's nullable attributes in older target frameworks like .NET Standard 2.0 or the "old" .NET Framework.
https://www.nuget.org/packages/Nullable
MIT License
184 stars 8 forks source link

Support for netstd < 2.0 #5

Closed Tyrrrz closed 4 years ago

Tyrrrz commented 4 years ago

Just by glancing at the project I can't see any indication if this will work in a project that targets, for example, .NET Standard 1.1. Does it? Are there technical limitations related to supporting lower versions?

manuelroemer commented 4 years ago

Hi, you are right, that's not documented anywhere - thank you for mentioning this! I'll update the README when I get to it. It should be compatible with any .NET Standard >= 1.0 and any "legacy" .NET FW >= 2.0.

If you have any troubles with such a target framework, be sure to tell me so that we can resolve the issue.

Tyrrrz commented 4 years ago

Cool! I'll check it out and report back.

Tyrrrz commented 4 years ago

Looks like it works. I noticed that you can't use ? to denote types that might be null, but you can use ! though. Is that expected?

Tyrrrz commented 4 years ago

Ugh, it looks like it's just ReSharper showing it up as an error.

manuelroemer commented 4 years ago

Glad to hear that it's working!

I can confirm that it's most likely ReSharper - the warnings work as expected in a netstandard1.0 app: grafik

It's surprising that it accepts ! but not ?. I would have expected this to be the other way around.

Tyrrrz commented 4 years ago

Cool, thanks for help :)