Moves ByReference to shared CoreLib (#21633)
authorMarek Safar <marek.safar@gmail.com>
Fri, 21 Dec 2018 19:15:08 +0000 (20:15 +0100)
committerJan Kotas <jkotas@microsoft.com>
Fri, 21 Dec 2018 19:15:08 +0000 (11:15 -0800)
src/System.Private.CoreLib/System.Private.CoreLib.csproj
src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
src/System.Private.CoreLib/shared/System/ByReference.cs [moved from src/System.Private.CoreLib/src/System/ByReference.cs with 79% similarity]

index 17fa5d7..f471ad6 100644 (file)
     <Compile Include="$(BclSourcesRoot)\System\Attribute.cs" />
     <Compile Include="$(BclSourcesRoot)\System\BadImageFormatException.CoreCLR.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Buffer.cs" />
-    <Compile Include="$(BclSourcesRoot)\System\ByReference.cs" />
     <Compile Include="$(BclSourcesRoot)\System\CLRConfig.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Collections\EmptyReadOnlyDictionaryInternal.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Collections\Generic\ArraySortHelper.CoreCLR.cs" />
index 0c40e26..27d43b7 100644 (file)
     <Compile Include="$(MSBuildThisFileDirectory)System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpan.LittleG.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpanSplitter.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Byte.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\ByReference.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Char.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\CharEnumerator.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\CLSCompliantAttribute.cs" />
@@ -13,24 +13,29 @@ namespace System
     [NonVersionable]
     internal readonly ref struct ByReference<T>
     {
-        private readonly IntPtr _value;
+        // CS0169: The private field '{blah}' is never used
+#pragma warning disable 169
+         private readonly IntPtr _value;
+#pragma warning restore
 
+        [Intrinsic]
         public ByReference(ref T value)
         {
             // Implemented as a JIT intrinsic - This default implementation is for 
             // completeness and to provide a concrete error if called via reflection
             // or if intrinsic is missed.
-            throw new System.PlatformNotSupportedException();
+            throw new PlatformNotSupportedException();
         }
 
         public ref T Value
         {
+            [Intrinsic]
             get
             {
                 // Implemented as a JIT intrinsic - This default implementation is for 
                 // completeness and to provide a concrete error if called via reflection
                 // or if the intrinsic is missed.
-                throw new System.PlatformNotSupportedException();
+                throw new PlatformNotSupportedException();
             }
         }
     }