Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Kanamori <AtsushiKan@users.noreply.github.com>2017-01-19 20:57:23 +0300
committerGitHub <noreply@github.com>2017-01-19 20:57:23 +0300
commit1ac148442ddab83c8023a498e086bae7eeabe1fd (patch)
tree7b0c616fee8aaaf0a55dabe1d586e7f0701263eb
parent9158af3dd51243cc7ee457b7deed6dbe2afe0019 (diff)
parent8b7a2b519420bbc4529ed96c44612651bd9cb086 (diff)
Merge pull request #2543 from AtsushiKan/virt
Make two System.Type methods virtual to conform with 4.2.0.0.
-rw-r--r--src/System.Private.CoreLib/src/System/Type.cs4
-rw-r--r--src/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.cs13
2 files changed, 15 insertions, 2 deletions
diff --git a/src/System.Private.CoreLib/src/System/Type.cs b/src/System.Private.CoreLib/src/System/Type.cs
index 8a9197464..4c54744a6 100644
--- a/src/System.Private.CoreLib/src/System/Type.cs
+++ b/src/System.Private.CoreLib/src/System/Type.cs
@@ -105,7 +105,7 @@ namespace System
public bool IsContextful => IsContextfulImpl();
protected virtual bool IsContextfulImpl() => typeof(ContextBoundObject).IsAssignableFrom(this);
- public bool IsEnum => IsSubclassOf(typeof(Enum));
+ public virtual bool IsEnum => IsSubclassOf(typeof(Enum));
public bool IsMarshalByRef => IsMarshalByRefImpl();
protected virtual bool IsMarshalByRefImpl() => typeof(MarshalByRefObject).IsAssignableFrom(this);
public bool IsPrimitive => IsPrimitiveImpl();
@@ -351,7 +351,7 @@ namespace System
return systemType.GetHashCode();
return base.GetHashCode();
}
- public bool Equals(Type o) => o == null ? false : object.ReferenceEquals(this.UnderlyingSystemType, o.UnderlyingSystemType);
+ public virtual bool Equals(Type o) => o == null ? false : object.ReferenceEquals(this.UnderlyingSystemType, o.UnderlyingSystemType);
public static bool operator ==(Type left, Type right)
{
diff --git a/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.cs b/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.cs
index 83cd7a4fc..58635acca 100644
--- a/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.cs
+++ b/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.cs
@@ -141,6 +141,11 @@ namespace System.Reflection.Runtime.TypeInfos
return object.ReferenceEquals(this, obj);
}
+ public sealed override bool Equals(Type o)
+ {
+ return object.ReferenceEquals(this, o);
+ }
+
public sealed override int GetHashCode()
{
return InternalGetHashCode();
@@ -302,6 +307,14 @@ namespace System.Reflection.Runtime.TypeInfos
}
}
+ public sealed override bool IsEnum
+ {
+ get
+ {
+ return 0 != (Classification & TypeClassification.IsEnum);
+ }
+ }
+
//
// Left unsealed as generic parameter types must override.
//