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

default struct value in method Error #13

Closed
ifshuaishuai opened this issue Dec 20, 2016 · 1 comment
Closed

default struct value in method Error #13

ifshuaishuai opened this issue Dec 20, 2016 · 1 comment

Comments

@ifshuaishuai
Copy link

public struct TestStruct
{
    public int id;

    public override string ToString()
    {
        return id.ToString();
    }
}

public static void TestMethodDefaultStructValue()
{
    PrintValue(100);
}

public static void PrintValue(int a, TestStruct b = default(TestStruct))
{
    Console.WriteLine("a = " + a + ", b = " + b.ToString());
}
@liiir1985
Copy link
Collaborator

Issue fixed

liiir1985 pushed a commit that referenced this issue Jun 8, 2018
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

No branches or pull requests

2 participants