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

Make type parameter T of the Null() method nullable and add overload for value types. #261

Merged
merged 13 commits into from
Jul 31, 2023

Conversation

amal-stack
Copy link
Contributor

@amal-stack amal-stack commented Feb 23, 2023

  • Solves Make T nullable #260 which suppresses nullable warnings.
  • Adds an additional overload of Null() with a value type constraint on T (where T : struct) to allow assignment to non-nullable value types when passed nullable value types (Enhanced support for value types #242) . For example, the following is now allowed with this overload:
int? nullableInt = 42;
int nonNullableInt = Guard.Against.Null(nullableInt, nameof(nullableInt));
  • Also added unit tests to ensure that the type of the return value is non-nullable.

@mwasson74
Copy link

Hey @amal-stack, me again from #258. I see you've submitted this PR. Do you know when this might be released? I see it's still "open" and says something about "Expected - Waiting for status to be reported" but I have no idea what that means 😬

@mwasson74
Copy link

Hey @amal-stack, me again. Sorry to keep bothering you, but it seems this got "stuck" again. Any idea when this will be merged and released?

@ardalis ardalis merged commit e6388c9 into ardalis:main Jul 31, 2023
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.

3 participants