diff options
author | David Wrighton <davidwr@microsoft.com> | 2017-08-30 02:47:58 +0300 |
---|---|---|
committer | David Wrighton <davidwr@microsoft.com> | 2017-08-30 02:47:58 +0300 |
commit | 6a44a21cf36ac61890fca9507658c07ad786d1a3 (patch) | |
tree | a11427f519a26de5e8578d8f23e791b51ef918f5 /src/System.Private.Interop | |
parent | cfe6c19b390ed051004e38c98b61fc6753126ac2 (diff) |
Fix issue where attemping to get Type equality on McgFakeMetadataTypes causes an exception
- Fix it to behave as it did before NS2.0 and be a reference equality operation
- NS 2.0 work brought along a new Equals method that needs to be overriden for correct behavior
[tfs-changeset: 1672183]
Diffstat (limited to 'src/System.Private.Interop')
-rw-r--r-- | src/System.Private.Interop/src/Shared/McgTypeHelpers.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/System.Private.Interop/src/Shared/McgTypeHelpers.cs b/src/System.Private.Interop/src/Shared/McgTypeHelpers.cs index 64e068128..115c84b6b 100644 --- a/src/System.Private.Interop/src/Shared/McgTypeHelpers.cs +++ b/src/System.Private.Interop/src/Shared/McgTypeHelpers.cs @@ -181,6 +181,15 @@ namespace System.Runtime.InteropServices return false; } + public override bool Equals(Type o) + { + // + // We guarantee uniqueness in Mcg marshalling code + // + + return Object.ReferenceEquals(this, o); + } + public override int GetHashCode() { return _fullTypeName.GetHashCode(); |