Fix pragma warning restore (dotnet/coreclr#26389)
[mono-project.git] / netcore / System.Private.CoreLib / shared / System / ByReference.cs
blobab51cb64952d3dadf87fd357104dbdd5cfca0438
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 using System.Runtime.CompilerServices;
6 using System.Runtime.Versioning;
8 namespace System
10 // ByReference<T> is meant to be used to represent "ref T" fields. It is working
11 // around lack of first class support for byref fields in C# and IL. The JIT and
12 // type loader has special handling for it that turns it into a thin wrapper around ref T.
13 [NonVersionable]
14 internal readonly ref struct ByReference<T>
16 // CS0169: The private field '{blah}' is never used
17 #pragma warning disable 169
18 #pragma warning disable CA1823
19 private readonly IntPtr _value;
20 #pragma warning restore CA1823
21 #pragma warning restore 169
23 [Intrinsic]
24 public ByReference(ref T value)
26 // Implemented as a JIT intrinsic - This default implementation is for
27 // completeness and to provide a concrete error if called via reflection
28 // or if intrinsic is missed.
29 throw new PlatformNotSupportedException();
32 public ref T Value
34 [Intrinsic]
35 get
37 // Implemented as a JIT intrinsic - This default implementation is for
38 // completeness and to provide a concrete error if called via reflection
39 // or if the intrinsic is missed.
40 throw new PlatformNotSupportedException();