Skip to content

Conversation

svick
Copy link
Contributor

@svick svick commented Nov 11, 2021

Fixes #57238.

Also add test for null parameter default value, since that is another special case.

@ghost ghost added area-System.Reflection.Metadata community-contribution Indicates that the PR has been added by a community member labels Nov 11, 2021
@ghost
Copy link

ghost commented Nov 11, 2021

Tagging subscribers to this area: @buyaa-n
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #57238.

Also add test for null parameter default value, since that is another special case.

Author: svick
Assignees: -
Labels:

area-System.Reflection.Metadata

Milestone: -

public void Foo4(short s = -34) { }
public void Foo5(decimal d = 1234m) { }
public void Foo6([DateTimeConstant(ticks: 8736726782)] DateTime dt) { }
public void Foo7(string s1 = "foo", string s2 = "") { }
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: maybe add a test case for null default?

Suggested change
public void Foo7(string s1 = "foo", string s2 = "") { }
public void Foo7(string s1 = "foo", string s2 = "", string s3 = null) { }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, done.

Copy link
Contributor

@buyaa-n buyaa-n left a comment

Choose a reason for hiding this comment

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

Left and NIT, overall LGTM, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Reflection.Metadata community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParameterInfo.RawDefaultValue throws when default value is string.empty

3 participants