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

Add missing nullability annotation to string ctor #31702

Merged
merged 1 commit into from
Feb 4, 2020

Conversation

GrabYourPitchforks
Copy link
Member

The constructor string(char[] value) allows null as an input. We forgot to put the ? annotation on the parameter. There's already a unit test validating that we allow null inputs, as shown below.

[InlineData(null, 0, 0, "")]
public static void Ctor_CharArray(char[] value, int startIndex, int length, string expected)
{
if (value == null)
{
Assert.Equal(expected, new string(value));
return;
}

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks.

@jkotas
Copy link
Member

jkotas commented Feb 4, 2020

The CI failures are know issue #2176

@jkotas jkotas merged commit 94ca567 into dotnet:master Feb 4, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants