Adjust for roslyn change on ref parameters and NotNullIfNotNull (#42707)
authorJulien Couvreur <jcouv@users.noreply.github.com>
Fri, 25 Sep 2020 15:27:10 +0000 (08:27 -0700)
committerGitHub <noreply@github.com>
Fri, 25 Sep 2020 15:27:10 +0000 (11:27 -0400)
* Adjust for roslyn change on ref parameters

* Adjust for roslyn change on NotNullIfNotNull

src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs
src/libraries/System.Private.CoreLib/src/System/Threading/LazyInitializer.cs

index f979ed4..22a9185 100644 (file)
@@ -585,7 +585,7 @@ namespace System.Runtime.InteropServices
                 if (!SetComObjectData(o, t, Wrapper))
                 {
                     // Another thead already cached the wrapper so use that one instead.
-                    Wrapper = GetComObjectData(o, t);
+                    Wrapper = GetComObjectData(o, t)!;
                 }
             }
 
index 5f13e3d..b2703e7 100644 (file)
@@ -143,7 +143,7 @@ namespace System.Threading
                 return target!;
             }
 
-            return EnsureInitializedCore(ref target, ref initialized, ref syncLock);
+            return EnsureInitializedCore<T>(ref target, ref initialized, ref syncLock);
         }
 
         /// <summary>