-
Notifications
You must be signed in to change notification settings - Fork 41
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
Use nullable #85
base: master
Are you sure you want to change the base?
Use nullable #85
Conversation
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.
So, we'll have to have the nullable preview to build locally?
I wasn’t really planning on merging, I just wanted to see what it would take, and what the changes looked like. |
// Can't figure out how to not get a warning here. | ||
#pragma warning disable CS8603 | ||
return this[index]; | ||
#pragma warning restore |
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.
Could add a ?? throw
here to remove the exception. That will function. Don't think that can be a shipping solution though.
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 tried that, and the warning didn't go away - maybe a bug in the preview.
@@ -11,12 +11,15 @@ public partial class MainWindow : Window | |||
{ | |||
public static Window Instance { get; private set; } | |||
|
|||
// WPF generates fields that are marked as non-nullable, but not definitely initialized. | |||
#pragma warning disable CS8618 |
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.
That's going to be a problem if we have to do this for every single WPF control.
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.
Indeed - see my mails to the LDM on the topic :-)
Annotate for the Nullable reference types preview.