Skip to content

Commit

Permalink
Add [CodeAnalysis.NotNull] for NotNull extension-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
saltukkos authored and ForNeVeR committed Dec 18, 2023
1 parent e945f60 commit 030831c
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit 030831c

Please sign in to comment.