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

Generate System.Runtime ref assembly against implementation #37737

Merged
merged 2 commits into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
32 changes: 23 additions & 9 deletions src/System.Runtime/ref/System.Runtime.Manual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@

namespace System
{
public partial struct Single
{
public const float MinValue = (float)-3.40282346638528859e+38;
public const float Epsilon = (float)1.4e-45;
public const float MaxValue = (float)3.40282346638528859e+38;
public const float PositiveInfinity = (float)1.0 / (float)0.0;
public const float NegativeInfinity = (float)-1.0 / (float)0.0;
public const float NaN = (float)0.0 / (float)0.0;
}
public partial struct Double
{
public const double MinValue = -1.7976931348623157E+308;
Expand All @@ -28,4 +19,27 @@ public partial struct Double
public const double PositiveInfinity = (double)1.0 / (double)(0.0);
public const double NaN = (double)0.0 / (double)0.0;
}
public partial struct Single
{
public const float MinValue = (float)-3.40282346638528859e+38;
public const float Epsilon = (float)1.4e-45;
public const float MaxValue = (float)3.40282346638528859e+38;
public const float PositiveInfinity = (float)1.0 / (float)0.0;
public const float NegativeInfinity = (float)-1.0 / (float)0.0;
public const float NaN = (float)0.0 / (float)0.0;
}
public ref partial struct TypedReference
{
// We need to add this into the manual ref assembly to preserve it because the
// implementation doesn't have any reference field, hence GenApi will not emit it.
private object _dummy;
private int _dummyPrimitive;
}
}
namespace System.Reflection
{
public partial class TypeDelegator
{
public override bool IsVariableBoundArray { get { throw null; } }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be manual? This looks like a bug in the implementation that this is working around.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this override doesn’t exist in the implementation. I tried to see when it was added but it was added on the initial commit to corefx. The implementation in coreclr has never had it.

Since the implementation doesn’t have it, if you run GenAPI it would remove it, so to avoid that I moved it to Manual.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the implementation doesn’t have it,

Right - this looks like an oversight in the implementation. It would be better to fix the implementation instead of adding a workaround here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll fix the implementation and put this back on the generated ref assembly.

}
}
Loading