Skip to content

Conversation

@lucasnobredev
Copy link
Contributor

Summary

This PR is from dotnet/docs#8700.

Fixes dotnet/docs#8700

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this is great @lucasnobredev Thanks for continuing to contribute to docs.

I did make one suggestion because we should update that sample in a different way to address an issue. Once you update that, I'll merge this PR.

Console.WriteLine("Its use could result in a NullReferenceException");
}
else if (obj is var _)
else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave this sample as is for the moment. Issue dotnet/docs#8727 points to the need for a better sample. I'd rather leave this in place until we make a new sample that shows the usage better.

Copy link

@rpetrusha rpetrusha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @lucasnobredev. The final change in this PR requires a change in the dotnet/docs repo, though. Could you open a PR to do that? I've requested changes here so that the two PRs can be merged at the same time.

Console.WriteLine("Its use could result in a NullReferenceException");
}
else if (obj is var _)
else

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this change is acceptable, it requires a change to example description. The example is used in Discards - C# Guide, where the sentence "It also used the discard pattern to handle non-null objects of any other type." needs to be removed. Could you open a PR to do that?

@rpetrusha
Copy link

@BillWagner and I reviewed this at about the same time, @lucasnobredev. I agree with him, though, that the final example should be left in place until we come up with a better example. Since you've also made the same update in #425, the last change can be reverted.

@lucasnobredev
Copy link
Contributor Author

@rpetrusha @BillWagner Done!
I probably mix up the commit between branches. That's why was repeated.
Like you asked, I'll open a PR to Discards - C# Guide and I'll point it to #425 and dotnet/docs#8727.

Thank you, guys.

@lucasnobredev
Copy link
Contributor Author

@rpetrusha @BillWagner I was reading the article again and it seems like if we remove condition of code and remove the phrase "It also used the discard pattern to handle non-null objects of any other type", the section lost the sense to exist. I'll take this comment to dotnet/docs#8727 and I'll wait.

@BillWagner
Copy link
Member

I looked at the latest updates, and I'm ready to :shipit:

Let me know what you think @rpetrusha

@rpetrusha
Copy link

rpetrusha commented Nov 14, 2018

I agree that this is ready to merge, @BillWagner. Thanks, @lucasnobredev. I've tagged this as merge on hold for live update, since the merge to live build is still running. It can be merged once that build completes and the merge-to-live PR is closed.

@rpetrusha rpetrusha added verify-build-before-merge Indicates PRs that are waiting for the build to finish before they get merged merge-on-hold-for-live-update Indicates PRs that shouldn't be merged until the live branch has finished updating and removed verify-build-before-merge Indicates PRs that are waiting for the build to finish before they get merged merge-on-hold-for-live-update Indicates PRs that shouldn't be merged until the live branch has finished updating labels Nov 14, 2018
@rpetrusha rpetrusha merged commit 0e26ec2 into dotnet:master Nov 15, 2018
@mairaw mairaw added the 📁 Repo - samples Indicates PRs done in the samples repo. label Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📁 Repo - samples Indicates PRs done in the samples repo.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants