-
Notifications
You must be signed in to change notification settings - Fork 132
Nullable annotations #546
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
Nullable annotations #546
Conversation
sharwell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed 30/66 files. If you want me to finish the complete review let me know. 😄
| [Required] | ||
| public ITaskItem SourceRoot { get; set; } | ||
| [Required, NotNull] | ||
| public ITaskItem? SourceRoot { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Since this property is [Required], you can remove the NotNull and ? and instead use this pattern:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I like the other pattern better. Is there a benefit?
| <Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" /> | ||
|
|
||
| <PropertyGroup> | ||
| <LangVersion>Preview</LangVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Might as well make this 8 now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to keep using the latest features even when in preview.
| [Required] | ||
| public string ProjectDirectory { get; set; } | ||
| [Required, NotNull] | ||
| public string? ProjectDirectory { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 These can both be marked non-null using the pattern shown above
No description provided.