Workaround potential compiler nullability bug
authorStephen Toub <stoub@microsoft.com>
Fri, 28 Jun 2019 14:50:25 +0000 (10:50 -0400)
committerStephen Toub <stoub@microsoft.com>
Sat, 29 Jun 2019 02:26:40 +0000 (22:26 -0400)
Commit migrated from https://github.com/dotnet/corefx/commit/5e3b0ae04986e9527eb51d3717ab96727c215c03

src/libraries/System.Memory/src/System/Buffers/ReadOnlySequence.cs

index c9f6d52..a9d6179 100644 (file)
@@ -146,7 +146,9 @@ namespace System.Buffers
         /// </summary>
         public ReadOnlySequence(ReadOnlyMemory<T> memory)
         {
+#pragma warning disable CS8631 // TODO-NULLABLE: Unexpected compiler error: https://github.com/dotnet/corefx/pull/38983#issuecomment-506757237
             if (MemoryMarshal.TryGetMemoryManager(memory, out MemoryManager<T>? manager, out int index, out int length))
+#pragma warning restore CS8631
             {
                 _startObject = manager;
                 _endObject = manager;