Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better Null Reference Type support #151

Open
Tracked by #212
shibayan opened this issue Aug 14, 2021 · 1 comment
Open
Tracked by #212

Add better Null Reference Type support #151

shibayan opened this issue Aug 14, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@shibayan
Copy link
Owner

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");
@shibayan shibayan added the enhancement New feature or request label Aug 14, 2021
@shibayan shibayan self-assigned this Aug 14, 2021
@shibayan shibayan added this to the v2.4.0 Release milestone Aug 14, 2021
@shibayan shibayan modified the milestones: v3.0.0 Release, Backlog Nov 13, 2022
@shibayan
Copy link
Owner Author

Currently in C#, nullability passed as a type parameter does not seem to be obtainable via reflection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant