summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Enum.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Enum.cs')
-rw-r--r--src/mscorlib/src/System/Enum.cs17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mscorlib/src/System/Enum.cs b/src/mscorlib/src/System/Enum.cs
index 25a4ff34d3..b5d00fe60e 100644
--- a/src/mscorlib/src/System/Enum.cs
+++ b/src/mscorlib/src/System/Enum.cs
@@ -12,6 +12,18 @@ using System.Runtime.Versioning;
using System.Diagnostics;
using System.Diagnostics.Contracts;
+// The code below includes partial support for float/double and
+// pointer sized enums.
+//
+// The type loader does not prohibit such enums, and older versions of
+// the ECMA spec include them as possible enum types.
+//
+// However there are many things broken throughout the stack for
+// float/double/intptr/uintptr enums. There was a conscious decision
+// made to not fix the whole stack to work well for them because of
+// the right behavior is often unclear, and it is hard to test and
+// very low value because of such enums cannot be expressed in C#.
+
namespace System
{
[Serializable]
@@ -425,7 +437,7 @@ namespace System
}
if (firstNonWhitespaceIndex == -1)
{
- parseResult.SetFailure(ParseFailureKind.Argument, "Arg_MustContainEnumInfo", null);
+ parseResult.SetFailure(ParseFailureKind.Argument, nameof(SR.Arg_MustContainEnumInfo), null);
return false;
}
@@ -506,7 +518,7 @@ namespace System
if (!success)
{
// Not found, throw an argument exception.
- parseResult.SetFailure(ParseFailureKind.ArgumentWithParameter, "Arg_EnumValueNotFound", value);
+ parseResult.SetFailure(ParseFailureKind.ArgumentWithParameter, nameof(SR.Arg_EnumValueNotFound), value);
return false;
}
@@ -961,6 +973,7 @@ namespace System
return ToString();
}
+ [Intrinsic]
public Boolean HasFlag(Enum flag)
{
if (flag == null)