Skip to content

Commit

Permalink
Add CompareReferenceInSameModule convenience properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektroKill committed Sep 1, 2023
1 parent 532a392 commit 552d570
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/DotNet/SigComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public sealed class TypeEqualityComparer : IEqualityComparer<IType>, IEqualityCo
/// </summary>
public static readonly TypeEqualityComparer CaseInsensitive = new TypeEqualityComparer(SigComparerOptions.CaseInsensitiveAll);

/// <summary>
/// Compares definitions in same module using reference comparison instead of comparing them by name, signature, etc.
/// </summary>
public static readonly TypeEqualityComparer CompareReferenceInSameModule = new TypeEqualityComparer(SigComparerOptions.ReferenceCompareForMemberDefsInSameModule);

/// <summary>
/// Constructor
/// </summary>
Expand Down Expand Up @@ -96,6 +101,11 @@ public sealed class FieldEqualityComparer : IEqualityComparer<IField>, IEquality
/// </summary>
public static readonly FieldEqualityComparer CaseInsensitiveDontCompareDeclaringTypes = new FieldEqualityComparer(SigComparerOptions.CaseInsensitiveAll);

/// <summary>
/// Compares definitions in same module using reference comparison instead of comparing them by name, signature, etc.
/// </summary>
public static readonly FieldEqualityComparer CompareReferenceInSameModule = new FieldEqualityComparer(SigComparerOptions.ReferenceCompareForMemberDefsInSameModule);

/// <summary>
/// Constructor
/// </summary>
Expand Down Expand Up @@ -147,6 +157,11 @@ public sealed class MethodEqualityComparer : IEqualityComparer<IMethod>, IEquali
/// </summary>
public static readonly MethodEqualityComparer CaseInsensitiveDontCompareDeclaringTypes = new MethodEqualityComparer(SigComparerOptions.CaseInsensitiveAll);

/// <summary>
/// Compares definitions in same module using reference comparison instead of comparing them by name, signature, etc.
/// </summary>
public static readonly MethodEqualityComparer CompareReferenceInSameModule = new MethodEqualityComparer(SigComparerOptions.ReferenceCompareForMemberDefsInSameModule);

/// <summary>
/// Constructor
/// </summary>
Expand Down Expand Up @@ -210,6 +225,11 @@ public sealed class PropertyEqualityComparer : IEqualityComparer<PropertyDef> {
/// </summary>
public static readonly PropertyEqualityComparer CaseInsensitiveDontCompareDeclaringTypes = new PropertyEqualityComparer(SigComparerOptions.CaseInsensitiveAll);

/// <summary>
/// Compares definitions in same module using reference comparison instead of comparing them by name, signature, etc.
/// </summary>
public static readonly PropertyEqualityComparer CompareReferenceInSameModule = new PropertyEqualityComparer(SigComparerOptions.ReferenceCompareForMemberDefsInSameModule);

/// <summary>
/// Constructor
/// </summary>
Expand Down Expand Up @@ -249,6 +269,11 @@ public sealed class EventEqualityComparer : IEqualityComparer<EventDef> {
/// </summary>
public static readonly EventEqualityComparer CaseInsensitiveDontCompareDeclaringTypes = new EventEqualityComparer(SigComparerOptions.CaseInsensitiveAll);

/// <summary>
/// Compares definitions in same module using reference comparison instead of comparing them by name, signature, etc.
/// </summary>
public static readonly EventEqualityComparer CompareReferenceInSameModule = new EventEqualityComparer(SigComparerOptions.ReferenceCompareForMemberDefsInSameModule);

/// <summary>
/// Constructor
/// </summary>
Expand Down

0 comments on commit 552d570

Please sign in to comment.