Use T? for unconstrained nullable types (#40197)
authorStephen Toub <stoub@microsoft.com>
Fri, 7 Aug 2020 15:25:42 +0000 (11:25 -0400)
committerGitHub <noreply@github.com>
Fri, 7 Aug 2020 15:25:42 +0000 (11:25 -0400)
commite7204f5d6fcaca5e097ec854b3be6055229fc442
tree6a933a8955124d6266de72f6e973128d84f33bd1
parent5ca480ea678ad2ea6c9abe54e32ce80a3970782a
Use T? for unconstrained nullable types (#40197)

* Temporarily upgrade compiler version for T? support

* Use T? for unconstrained nullable types
171 files changed:
docs/coding-guidelines/api-guidelines/nullability.md
eng/Versions.props
src/coreclr/src/System.Private.CoreLib/src/System/GC.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs
src/libraries/Common/src/System/Data/ProviderBase/DbReferenceCollection.cs
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicStream.cs
src/libraries/Common/src/System/Threading/Tasks/RendezvousAwaitable.cs
src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/ref/Microsoft.Extensions.DependencyInjection.Abstractions.cs
src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ServiceProviderServiceExtensions.cs
src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs
src/libraries/System.Collections.Concurrent/ref/System.Collections.Concurrent.cs
src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs
src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentBag.cs
src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs
src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/AllocFreeConcurrentStack.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableListQueries.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.HashBucket.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableInterlocked.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Node.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Node.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Node.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/SecureObjectPool.cs
src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/SortedInt32KeyNode.cs
src/libraries/System.Collections.Immutable/src/System/Linq/ImmutableArrayExtensions.cs
src/libraries/System.Collections/ref/System.Collections.cs
src/libraries/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs
src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs
src/libraries/System.Collections/src/System/Collections/Generic/Queue.cs
src/libraries/System.Collections/src/System/Collections/Generic/SortedDictionary.cs
src/libraries/System.Collections/src/System/Collections/Generic/SortedList.cs
src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.TreeSubSet.cs
src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs
src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs
src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CompositionResultOfT.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataServices.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs
src/libraries/System.Data.Common/ref/System.Data.Common.cs
src/libraries/System.Data.Common/src/System/Data/Common/DbDataReaderExtensions.cs
src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt64Storage.cs
src/libraries/System.Data.Common/src/System/Data/DataRowExtensions.cs
src/libraries/System.Data.Common/src/System/Data/DataViewSettingCollection.cs
src/libraries/System.Data.Common/src/System/Data/RbTree.cs
src/libraries/System.Data.Common/src/System/Data/SortExpressionBuilder.cs
src/libraries/System.Data.Common/src/System/Data/TypedTableBaseExtensions.cs
src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs
src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbReferenceCollection.cs
src/libraries/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerator.Unix.cs
src/libraries/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerator.Windows.cs
src/libraries/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerator.cs
src/libraries/System.IO.FileSystem/src/System/IO/Iterator.cs
src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/CacheDict.cs
src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.cs
src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs
src/libraries/System.Linq.Parallel/ref/System.Linq.Parallel.cs
src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs
src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs
src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Helpers.cs
src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs
src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs
src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/ConcatQueryOperator.cs
src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ReverseComparer.cs
src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs
src/libraries/System.Linq.Queryable/ref/System.Linq.Queryable.cs
src/libraries/System.Linq.Queryable/src/System/Linq/CachedReflection.cs
src/libraries/System.Linq.Queryable/src/System/Linq/Queryable.cs
src/libraries/System.Linq/ref/System.Linq.cs
src/libraries/System.Linq/src/System/Linq/DefaultIfEmpty.cs
src/libraries/System.Linq/src/System/Linq/ElementAt.cs
src/libraries/System.Linq/src/System/Linq/First.cs
src/libraries/System.Linq/src/System/Linq/IPartition.cs
src/libraries/System.Linq/src/System/Linq/Last.cs
src/libraries/System.Linq/src/System/Linq/Max.cs
src/libraries/System.Linq/src/System/Linq/Min.cs
src/libraries/System.Linq/src/System/Linq/OrderedEnumerable.SpeedOpt.cs
src/libraries/System.Linq/src/System/Linq/OrderedEnumerable.cs
src/libraries/System.Linq/src/System/Linq/Partition.SpeedOpt.cs
src/libraries/System.Linq/src/System/Linq/Repeat.SpeedOpt.cs
src/libraries/System.Linq/src/System/Linq/Select.SpeedOpt.cs
src/libraries/System.Linq/src/System/Linq/Single.cs
src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs
src/libraries/System.Net.Http.Json/ref/System.Net.Http.Json.cs
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpClientJsonExtensions.Get.cs
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.cs
src/libraries/System.Net.Http/tests/StressTests/HttpStress/StressClient.cs
src/libraries/System.Net.Security/src/System/Security/Authentication/ExtendedProtection/ServiceNameCollection.cs
src/libraries/System.ObjectModel/src/System/Collections/ObjectModel/KeyedCollection.cs
src/libraries/System.Private.CoreLib/src/System/Action.cs
src/libraries/System.Private.CoreLib/src/System/Array.cs
src/libraries/System.Private.CoreLib/src/System/Collections/Concurrent/ConcurrentQueue.cs
src/libraries/System.Private.CoreLib/src/System/Collections/Concurrent/ConcurrentQueueSegment.cs
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Comparer.cs
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.cs
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/IComparer.cs
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/IEqualityComparer.cs
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs
src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/Collection.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs
src/libraries/System.Private.CoreLib/src/System/IComparable.cs
src/libraries/System.Private.CoreLib/src/System/IEquatable.cs
src/libraries/System.Private.CoreLib/src/System/Lazy.cs
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.cs
src/libraries/System.Private.CoreLib/src/System/Resources/ResourceSet.cs
src/libraries/System.Private.CoreLib/src/System/Resources/RuntimeResourceSet.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskCache.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncValueTaskMethodBuilderT.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.NoCom.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs
src/libraries/System.Private.CoreLib/src/System/SpanHelpers.BinarySearch.cs
src/libraries/System.Private.CoreLib/src/System/Threading/AsyncLocal.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ProducerConsumerQueues.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Sources/ManualResetValueTaskSourceCore.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ValueTask.cs
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadLocal.cs
src/libraries/System.Private.CoreLib/src/System/Type.Helpers.cs
src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/EnumerableExtensions.cs
src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.cs
src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectWriter.cs
src/libraries/System.Runtime/ref/System.Runtime.cs
src/libraries/System.Security.Cryptography.Cng/ref/System.Security.Cryptography.Cng.cs
src/libraries/System.Security.Cryptography.Cng/src/Microsoft/Win32/SafeHandles/NCryptSafeHandles.cs
src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.cs
src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/PkcsPalWindows.cs
src/libraries/System.Text.Json/ref/System.Text.Json.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.ReadCore.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonPropertyInfoOfT.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonResumableConverterOfT.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Helpers.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Span.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Stream.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.String.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Utf8JsonReader.cs
src/libraries/System.Text.RegularExpressions/src/System/Collections/HashtableExtensions.cs
src/libraries/System.Threading.Channels/src/System/Threading/Channels/AsyncOperation.cs
src/libraries/System.Threading.Channels/src/System/Threading/Channels/BoundedChannel.cs
src/libraries/System.Threading.Channels/src/System/Threading/Channels/UnboundedChannel.cs
src/libraries/System.Threading.Tasks.Dataflow/ref/System.Threading.Tasks.Dataflow.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Base/DataflowBlock.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Base/ISourceBlock.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BatchBlock.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BatchedJoinBlock.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BroadcastBlock.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BufferBlock.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/TransformBlock.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/TransformManyBlock.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/WriteOnceBlock.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Internal/Common.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Internal/ReorderingBuffer.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Internal/SourceCore.cs
src/libraries/System.Threading.Tasks.Dataflow/src/Internal/TargetRegistry.cs
src/libraries/System.Threading/ref/System.Threading.cs
src/mono/netcore/System.Private.CoreLib/src/System/TypeIdentifier.cs
src/mono/netcore/System.Private.CoreLib/src/System/WeakReference.T.Mono.cs