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

Use nullable #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Use nullable #85

wants to merge 2 commits into from

Conversation

Pilchie
Copy link
Owner

@Pilchie Pilchie commented May 5, 2018

Annotate for the Nullable reference types preview.

@Pilchie Pilchie requested review from DustinCampbell and jaredpar May 5, 2018 23:22
Copy link
Collaborator

@DustinCampbell DustinCampbell left a 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?

@Pilchie
Copy link
Owner Author

Pilchie commented May 6, 2018

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
Copy link
Collaborator

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.

Copy link
Owner Author

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
Copy link
Collaborator

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.

Copy link
Owner Author

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 :-)

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

Successfully merging this pull request may close these issues.

3 participants