From fb6043adf72d8b7687d5b495dc7c888c82eea016 Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Fri, 7 Aug 2020 15:09:56 +0100 Subject: [PATCH] fix nullable annotation for ImmutableInterlocked.Update methods (#40459) --- .../System.Collections.Immutable/ref/System.Collections.Immutable.cs | 4 ++-- .../src/System/Collections/Immutable/ImmutableInterlocked.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs index c8daf5a..5c77291 100644 --- a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs +++ b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs @@ -520,8 +520,8 @@ namespace System.Collections.Immutable public static bool TryPop(ref System.Collections.Immutable.ImmutableStack location, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out T value) { throw null; } public static bool TryRemove(ref System.Collections.Immutable.ImmutableDictionary location, TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value) where TKey : notnull { throw null; } public static bool TryUpdate(ref System.Collections.Immutable.ImmutableDictionary location, TKey key, TValue newValue, TValue comparisonValue) where TKey : notnull { throw null; } - public static bool Update(ref T location, System.Func transformer) where T : class { throw null; } - public static bool Update(ref T location, System.Func transformer, TArg transformerArgument) where T : class { throw null; } + public static bool Update(ref T location, System.Func transformer) where T : class? { throw null; } + public static bool Update(ref T location, System.Func transformer, TArg transformerArgument) where T : class? { throw null; } public static bool Update(ref System.Collections.Immutable.ImmutableArray location, Func, System.Collections.Immutable.ImmutableArray> transformer) { throw null; } public static bool Update(ref System.Collections.Immutable.ImmutableArray location, Func, TArg, System.Collections.Immutable.ImmutableArray> transformer, TArg transformerArgument) { throw null; } } diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableInterlocked.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableInterlocked.cs index 6d3ba17..f907de4 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableInterlocked.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableInterlocked.cs @@ -30,7 +30,7 @@ namespace System.Collections.Immutable /// false if the location's value remained the same because the last /// invocation of returned the existing value. /// - public static bool Update(ref T location, Func transformer) where T : class + public static bool Update(ref T location, Func transformer) where T : class? { Requires.NotNull(transformer, nameof(transformer)); @@ -74,7 +74,7 @@ namespace System.Collections.Immutable /// false if the location's value remained the same because the last /// invocation of returned the existing value. /// - public static bool Update(ref T location, Func transformer, TArg transformerArgument) where T : class + public static bool Update(ref T location, Func transformer, TArg transformerArgument) where T : class? { Requires.NotNull(transformer, nameof(transformer)); -- 2.7.4