Skip to content

Include TypeNameBuilder.cs from CoreLib instead of copying the file over #89144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
// It replaces the C++ bits of the implementation with a faithful C# port.

using System.Collections.Generic;
using System.Collections;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Diagnostics;

Expand All @@ -20,7 +17,6 @@ internal sealed class TypeNameBuilder
private bool _firstInstArg;
private bool _nestedName;
private bool _hasAssemblySpec;
private bool _useAngleBracketsForGenerics;
private readonly List<int> _stack = new List<int>();
private int _stackIdx;

Expand All @@ -33,10 +29,7 @@ private void OpenGenericArguments()
_instNesting++;
_firstInstArg = true;

if (_useAngleBracketsForGenerics)
Append('<');
else
Append('[');
Append('[');
}

private void CloseGenericArguments()
Expand All @@ -51,10 +44,7 @@ private void CloseGenericArguments()
}
else
{
if (_useAngleBracketsForGenerics)
Append('>');
else
Append(']');
Append(']');
}
}

Expand All @@ -69,10 +59,7 @@ private void OpenGenericArgument()

_firstInstArg = false;

if (_useAngleBracketsForGenerics)
Append('<');
else
Append('[');
Append('[');

PushOpenGenericArgument();
}
Expand All @@ -83,10 +70,7 @@ private void CloseGenericArgument()

if (_hasAssemblySpec)
{
if (_useAngleBracketsForGenerics)
Append('>');
else
Append(']');
Append(']');
}

PopOpenGenericArgument();
Expand Down Expand Up @@ -239,11 +223,6 @@ private void PopOpenGenericArgument()
_hasAssemblySpec = false;
}

private void SetUseAngleBracketsForGenerics(bool value)
{
_useAngleBracketsForGenerics = value;
}

private void Append(string pStr)
{
int i = pStr.IndexOf('\0');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ContractTypesPartiallyMoved>true</ContractTypesPartiallyMoved>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CoreLibSharedDir)System\Reflection\Emit\TypeNameBuilder.cs" Link="System\Reflection\Emit\TypeNameBuilder.cs" />
<Compile Include="System\Reflection\Emit\CustomAttributeWrapper.cs" />
<Compile Include="System\Reflection\Emit\AssemblyBuilderImpl.cs" />
<Compile Include="System\Reflection\Emit\EnumBuilderImpl.cs" />
Expand All @@ -16,7 +17,6 @@
<Compile Include="System\Reflection\Emit\PseudoCustomAttributesData.cs" />
<Compile Include="System\Reflection\Emit\SignatureHelper.cs" />
<Compile Include="System\Reflection\Emit\TypeBuilderImpl.cs" />
<Compile Include="System\Reflection\Emit\TypeNameBuilder.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(CoreLibProject)" />
Expand Down
Loading