Sharprompt
Sharprompt copied to clipboard
Add better Null Reference Type support
Adopt NRT as a required condition for the value. I need to use NullabilityInfoContext
which will probably be added in NET 6.
https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-7/#getting-top-level-nullability-information
Proposal
// Value is required
var intValue = Prompt.Input<int>("Integer value");
var strValue = Prompt.Input<string>("String value");
// Value is optional
var optionalIntValue = Prompt.Input<int?>("Optional integer value");
var optionalStrValue = Prompt.Input<string?>("Optional string value");
Currently in C#, nullability passed as a type parameter does not seem to be obtainable via reflection.