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

Update primary-constructors.md #7124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update primary-constructors.md #7124

wants to merge 1 commit into from

Conversation

bernd5
Copy link
Contributor

@bernd5 bernd5 commented Apr 16, 2023

Fix code sample - there is no NullArgumentException in the BCL but a ArgumentNullException

Fix code sample - there is no NullArgumentException in the BCL but a ArgumentNullException
@bernd5 bernd5 requested a review from a team as a code owner April 16, 2023 12:18
public class C(bool b, int i, string s) : B(b) // b passed to base constructor
{
public int I { get; set; } = i; // i used for initialization
public string S // s used directly in function members
{
get => s;
set => s = value ?? throw new NullArgumentException(nameof(X));
set => s = value ?? throw new ArgumentNullException(nameof(X));
Copy link
Contributor

Choose a reason for hiding this comment

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

It seemed there's no X also, maybe we could use S instead?

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.

2 participants