Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Moves ByReference to shared CoreLib (#21633)
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-safar authored and jkotas committed Dec 21, 2018
1 parent 82e02f3 commit cc68e4a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/System.Private.CoreLib/System.Private.CoreLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
<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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
<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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down

0 comments on commit cc68e4a

Please sign in to comment.