From cc68e4af8388c7b85984d1fc769e90ddba14f3e5 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Fri, 21 Dec 2018 20:15:08 +0100 Subject: [PATCH] Moves ByReference to shared CoreLib (#21633) --- src/System.Private.CoreLib/System.Private.CoreLib.csproj | 1 - .../shared/System.Private.CoreLib.Shared.projitems | 1 + .../{src => shared}/System/ByReference.cs | 11 ++++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) rename src/System.Private.CoreLib/{src => shared}/System/ByReference.cs (79%) diff --git a/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/System.Private.CoreLib/System.Private.CoreLib.csproj index 17fa5d7..f471ad6 100644 --- a/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -130,7 +130,6 @@ - diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems index 0c40e26..27d43b7 100644 --- a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems +++ b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems @@ -111,6 +111,7 @@ + diff --git a/src/System.Private.CoreLib/src/System/ByReference.cs b/src/System.Private.CoreLib/shared/System/ByReference.cs similarity index 79% rename from src/System.Private.CoreLib/src/System/ByReference.cs rename to src/System.Private.CoreLib/shared/System/ByReference.cs index 298b4bb..492979a 100644 --- a/src/System.Private.CoreLib/src/System/ByReference.cs +++ b/src/System.Private.CoreLib/shared/System/ByReference.cs @@ -13,24 +13,29 @@ namespace System [NonVersionable] internal readonly ref struct ByReference { - 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(); } } } -- 2.7.4