Exemple #1
0
        public bool Equals(
            IParameterSymbol x,
            IParameterSymbol y,
            Dictionary <INamedTypeSymbol, INamedTypeSymbol> equivalentTypesWithDifferingAssemblies,
            bool compareParameterName,
            bool isCaseSensitive)
        {
            if (ReferenceEquals(x, y))
            {
                return(true);
            }

            if (x == null || y == null)
            {
                return(false);
            }

            var nameComparisonCheck = true;

            if (compareParameterName)
            {
                nameComparisonCheck = isCaseSensitive ?
                                      x.Name == y.Name
                    : string.Equals(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
            }

            // See the comment in the outer type.  If we're comparing two parameters for
            // equality, then we want to consider method type parameters by index only.

            return
                (AreRefKindsEquivalent(x.RefKind, y.RefKind, _distinguishRefFromOut) &&
                 nameComparisonCheck &&
                 _symbolEqualityComparer.GetEquivalenceVisitor().AreEquivalent(x.CustomModifiers, y.CustomModifiers, equivalentTypesWithDifferingAssemblies) &&
                 _symbolEqualityComparer.SignatureTypeEquivalenceComparer.Equals(x.Type, y.Type, equivalentTypesWithDifferingAssemblies));
        }
 public bool Equals(ITypeSymbol x, ITypeSymbol y, Dictionary <INamedTypeSymbol, INamedTypeSymbol> equivalentTypesWithDifferingAssemblies)
 {
     return(_symbolEquivalenceComparer.GetEquivalenceVisitor(compareMethodTypeParametersByIndex: true, objectAndDynamicCompareEqually: true).AreEquivalent(x, y, equivalentTypesWithDifferingAssemblies));
 }