* Update dependencies from https://github.com/dotnet/arcade build
20190611.2
- Microsoft.DotNet.XUnitExtensions - 2.4.1-beta.19311.2
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.19311.2
- Microsoft.DotNet.VersionTools.Tasks - 1.0.0-beta.19311.2
- Microsoft.DotNet.ApiCompat - 1.0.0-beta.19311.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Configuration - 1.0.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19311.2
- Microsoft.DotNet.CodeAnalysis - 1.0.0-beta.19311.2
- Microsoft.DotNet.CoreFxTesting - 1.0.0-beta.19311.2
- Microsoft.DotNet.GenAPI - 1.0.0-beta.19311.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19311.2
- Microsoft.DotNet.RemoteExecutor - 1.0.0-beta.19311.2
- Microsoft.DotNet.GenFacades - 1.0.0-beta.19311.2
* Update `where T : object` constraint to be `where T : notnull`
* Update several TODO-NULLABLE comments
Commit migrated from https://github.com/dotnet/corefx/commit/
28efaabc4349d11a95f8f31eb932c84f207916ab
/// </remarks>
[DebuggerTypeProxy(typeof(IDictionaryDebugView<,>))]
[DebuggerDisplay("Count = {Count}")]
- public class ConcurrentDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDictionary, IReadOnlyDictionary<TKey, TValue> where TKey : object
+ public class ConcurrentDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDictionary, IReadOnlyDictionary<TKey, TValue> where TKey : notnull
{
/// <summary>
/// Tables that hold the internal state of the ConcurrentDictionary
get { return _enumerator.Current.Value; }
}
-#pragma warning disable CS8612 // TODO-NULLABLE: Covariant return types (https://github.com/dotnet/roslyn/issues/23268)
+#pragma warning disable CS8612 // TODO-NULLABLE: Covariance in interfaces (https://github.com/dotnet/roslyn/issues/35227)
public object Current
#pragma warning restore CS8612
{
return false;
}
-#pragma warning disable CS8612 // TODO-NULLABLE: https://github.com/dotnet/roslyn/issues/23268
+#pragma warning disable CS8612 // TODO-NULLABLE: Covariance in interfaces (https://github.com/dotnet/roslyn/issues/35227)
public virtual object Current
#pragma warning restore CS8612
{
public static class CollectionExtensions
{
[return: MaybeNull]
- public static TValue GetValueOrDefault<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key) where TKey : object
+ public static TValue GetValueOrDefault<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key) where TKey : notnull
{
return dictionary.GetValueOrDefault(key, default(TValue)!); // TODO-NULLABLE: Remove ! when nullable attributes are respected
}
[return: MaybeNull]
- public static TValue GetValueOrDefault<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key, [AllowNull] TValue defaultValue) where TKey : object
+ public static TValue GetValueOrDefault<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key, [AllowNull] TValue defaultValue) where TKey : notnull
{
if (dictionary == null)
{
return dictionary.TryGetValue(key, out value) ? value : defaultValue;
}
- public static bool TryAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue value) where TKey : object
+ public static bool TryAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue value) where TKey : notnull
{
if (dictionary == null)
{
return false;
}
- public static bool Remove<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, [MaybeNullWhen(false)] out TValue value) where TKey : object
+ public static bool Remove<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, [MaybeNullWhen(false)] out TValue value) where TKey : notnull
{
if (dictionary == null)
{
[DebuggerDisplay("Count = {Count}")]
[Serializable]
[System.Runtime.CompilerServices.TypeForwardedFrom("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
- public class SortedDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDictionary, IReadOnlyDictionary<TKey, TValue> where TKey : object
+ public class SortedDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDictionary, IReadOnlyDictionary<TKey, TValue> where TKey : notnull
{
[NonSerialized]
private KeyCollection? _keys;
[Serializable]
[System.Runtime.CompilerServices.TypeForwardedFrom("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public class SortedList<TKey, TValue> :
- IDictionary<TKey, TValue>, IDictionary, IReadOnlyDictionary<TKey, TValue> where TKey : object
+ IDictionary<TKey, TValue>, IDictionary, IReadOnlyDictionary<TKey, TValue> where TKey : notnull
{
private TKey[] keys; // Do not rename (binary serialization)
private TValue[] values; // Do not rename (binary serialization)
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
- public partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple where TRest : object
+ public partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple where TRest : notnull
{
public Tuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest) { }
public T1 Item1 { get { throw null; } }
{
int Compare(T x, T y);
}
- public partial interface IDictionary<TKey, TValue> : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.IEnumerable where TKey : object
+ public partial interface IDictionary<TKey, TValue> : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.IEnumerable where TKey : notnull
{
TValue this[TKey key] { get; set; }
System.Collections.Generic.ICollection<TKey> Keys { get; }
{
int Count { get; }
}
- public partial interface IReadOnlyDictionary<TKey, TValue> : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.IEnumerable where TKey : object
+ public partial interface IReadOnlyDictionary<TKey, TValue> : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.IEnumerable where TKey : notnull
{
TValue this[TKey key] { get; }
System.Collections.Generic.IEnumerable<TKey> Keys { get; }
public partial class TextElementEnumerator : System.Collections.IEnumerator
{
internal TextElementEnumerator() { }
-#pragma warning disable CS8612 // TODO-NULLABLE: Covariant return types (https://github.com/dotnet/roslyn/issues/23268)
+#pragma warning disable CS8612 // TODO-NULLABLE: Covariance in interfaces (https://github.com/dotnet/roslyn/issues/35227)
public object Current { get { throw null; } }
#pragma warning restore CS8612
public int ElementIndex { get { throw null; } }