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 [CodeAnalysis.NotNull] for NotNull extension-methods #458

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions rd-net/Lifetimes/Diagnostics/Assertion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public static void AssertNotNull([CodeAnalysis.NotNull] object? condition, strin

[ContractAnnotation("value:null => void; => value:notnull, notnull")]
[MethodImpl(MethodImplAdvancedOptions.AggressiveInlining)]
public static T NotNull<T>(this T? value, [CallerArgumentExpression("value")] string? message = null)
public static T NotNull<T>([CodeAnalysis.NotNull] this T? value, [CallerArgumentExpression("value")] string? message = null)
where T : class
{
if (value == null)
Expand All @@ -231,7 +231,7 @@ public static T NotNull<T>(this T? value, [CallerArgumentExpression("value")] st
#if !NET35
[ContractAnnotation("value:null => void; => value:notnull, notnull")]
[MethodImpl(MethodImplAdvancedOptions.AggressiveInlining)]
public static T NotNull<T>(this T? value, [InterpolatedStringHandlerArgument("value")] ref JetNotNullConditionalInterpolatedStringHandler messageHandler)
public static T NotNull<T>([CodeAnalysis.NotNull] this T? value, [InterpolatedStringHandlerArgument("value")] ref JetNotNullConditionalInterpolatedStringHandler messageHandler)
where T : class
{
if (value == null)
Expand All @@ -246,7 +246,7 @@ public static T NotNull<T>(this T? value, [InterpolatedStringHandlerArgument("va
[ContractAnnotation("value:null => void; => value:notnull, notnull")]
[StringFormatMethod("args")]
[MethodImpl(MethodImplAdvancedOptions.AggressiveInlining)]
public static T NotNull<T>(this T? value, string message, params object?[] args)
public static T NotNull<T>([CodeAnalysis.NotNull] this T? value, string message, params object?[] args)
where T : class
{
if (value == null)
Expand All @@ -259,7 +259,7 @@ public static T NotNull<T>(this T? value, string message, params object?[] args)

[ContractAnnotation("value:null => void; => value:notnull")]
[MethodImpl(MethodImplAdvancedOptions.AggressiveInlining)]
public static T NotNull<T>(this T? value, [CallerArgumentExpression("value")] string? message = null)
public static T NotNull<T>([CodeAnalysis.NotNull] this T? value, [CallerArgumentExpression("value")] string? message = null)
where T : struct
{
if (value == null)
Expand All @@ -273,7 +273,7 @@ public static T NotNull<T>(this T? value, [CallerArgumentExpression("value")] st
#if !NET35
[ContractAnnotation("value:null => void; => value:notnull")]
[MethodImpl(MethodImplAdvancedOptions.AggressiveInlining)]
public static T NotNull<T>(this T? value, [InterpolatedStringHandlerArgument("value")] ref JetNotNullConditionalInterpolatedStringHandler messageHandler)
public static T NotNull<T>([CodeAnalysis.NotNull] this T? value, [InterpolatedStringHandlerArgument("value")] ref JetNotNullConditionalInterpolatedStringHandler messageHandler)
where T : struct
{
if (value == null)
Expand All @@ -287,7 +287,7 @@ public static T NotNull<T>(this T? value, [InterpolatedStringHandlerArgument("va

[ContractAnnotation("value:null => void; => value:notnull, notnull")]
[MethodImpl(MethodImplAdvancedOptions.AggressiveInlining)]
public static T NotNull<T>(this T? value, object debugMessage) where T : class
public static T NotNull<T>([CodeAnalysis.NotNull] this T? value, object debugMessage) where T : class
{
if (value == null)
{
Expand Down
Loading