7 implementations of Equals
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
225public bool Equals(ISymbol other, SymbolEqualityComparer equalityComparer)
Microsoft.CodeAnalysis.CSharp (3)
Symbols\PublicModel\PreprocessingSymbol.cs (1)
55bool ISymbol.Equals(ISymbol? other, CodeAnalysis.SymbolEqualityComparer equalityComparer)
Symbols\PublicModel\Symbol.cs (1)
94bool ISymbol.Equals(ISymbol other, CodeAnalysis.SymbolEqualityComparer equalityComparer)
Symbols\PublicModel\TypeSymbol.cs (1)
49bool ISymbol.Equals(ISymbol other, CodeAnalysis.SymbolEqualityComparer equalityComparer)
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
110public bool Equals(ISymbol other, SymbolEqualityComparer equalityComparer)
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
842Private Overloads Function ISymbol_Equals(other As ISymbol, equalityComparer As SymbolEqualityComparer) As Boolean Implements ISymbol.Equals
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
225public bool Equals(ISymbol other, SymbolEqualityComparer equalityComparer)
128 references to Equals
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (1)
963&& secondParam.Name == "paramName" && secondParam.Type.Equals(_typeSymbols.String, SymbolEqualityComparer.Default))
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
185matchParams = invocationArgList[i].Equals(methodSymbol.Parameters[i].Type, SymbolEqualityComparer.Default);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (4)
StaticRouteHandlerModel\EndpointResponse.cs (4)
53if (returnType.OriginalDefinition.Equals(taskOfT, SymbolEqualityComparer.Default) || 54returnType.OriginalDefinition.Equals(valueTaskOfT, SymbolEqualityComparer.Default)) 61if (returnType.OriginalDefinition.Equals(task, SymbolEqualityComparer.Default) || 62returnType.OriginalDefinition.Equals(valueTask, SymbolEqualityComparer.Default))
Microsoft.CodeAnalysis (4)
DocumentationCommentId.cs (2)
1264if (returnType != null && methodSymbol.ReturnType.Equals(returnType, SymbolEqualityComparer.CLRSignature)) 1407return parameterType != null && symbol.Type.Equals(parameterType, SymbolEqualityComparer.CLRSignature);
Symbols\ISymbolExtensions.cs (1)
153!lockType.Equals(scopeType.ContainingType, SymbolEqualityComparer.ConsiderEverything))
Symbols\SymbolEqualityComparer.cs (1)
57return x.Equals(y, this);
Microsoft.CodeAnalysis.CodeStyle (4)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (3)
144if (!targetTypeSymbol.Equals(enumerableType, SymbolEqualityComparer.Default) && 157=> whereMethod.Equals(invocation.TargetMethod.ReducedFrom ?? invocation.TargetMethod.OriginalDefinition, SymbolEqualityComparer.Default); 160=> linqMethods.Any(static (m, invocation) => m.Equals(invocation.TargetMethod.ReducedFrom ?? invocation.TargetMethod.OriginalDefinition, SymbolEqualityComparer.Default), invocation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
234return method.Parameters.Any(static (p, within) => p.Type.Equals(within, SymbolEqualityComparer.Default), within);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (1)
67if (!symbolInfo.Symbol.Equals(newSymbolInfo.Symbol, SymbolEqualityComparer.IncludeNullability))
Microsoft.CodeAnalysis.CSharp.CodeStyle (9)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
257if (method1 is not null && !method1.Equals(method2, SymbolEqualityComparer.IncludeNullability))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (8)
512if (originalConvertedType.Equals(rewrittenConvertedType, SymbolEqualityComparer.IncludeNullability)) 525rewrittenConvertedType.Equals(targetType, SymbolEqualityComparer.IncludeNullability)) 601if (originalConvertedType.Equals(castedType, SymbolEqualityComparer.IncludeNullability)) 616if (!originalNamedConvertedType.TypeArguments[0].Equals(namedCastedType.TypeArguments[0], SymbolEqualityComparer.IncludeNullability)) 795if (!originalConvertedType.Equals(rewrittenBitwiseNotConversionType, SymbolEqualityComparer.IncludeNullability)) 855if (!originalConditionalTypeInfo.ConvertedType!.Equals(rewrittenConditionalTypeInfo.ConvertedType, SymbolEqualityComparer.IncludeNullability)) 865if (castType.Equals(rewrittenConditionalOperation.Type, SymbolEqualityComparer.IncludeNullability)) 870castType.Equals(conditionalParentConversion.Type, SymbolEqualityComparer.IncludeNullability))
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
CodeGen\CodeGenTupleTest.cs (4)
6815Assert.False(tuple1.Equals(tuple2, SymbolEqualityComparer.IncludeNullability)); 6884Assert.False(tuple1.Equals(tuple2, SymbolEqualityComparer.IncludeNullability)); 27502Assert.False(type.Equals(underlyingType, SymbolEqualityComparer.Default)); 27503Assert.False(type.Equals(underlyingType, SymbolEqualityComparer.ConsiderEverything));
Microsoft.CodeAnalysis.CSharp.Features (2)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
307methodParameterType.Equals(overloadParameter.Type, SymbolEqualityComparer.Default))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
257if (method1 is not null && !method1.Equals(method2, SymbolEqualityComparer.IncludeNullability))
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (27)
Semantics\NativeIntegerTests.cs (3)
268Assert.False(underlyingType.Equals(nativeIntegerType, SymbolEqualityComparer.Default)); 269Assert.False(underlyingType.Equals(nativeIntegerType, SymbolEqualityComparer.IncludeNullability)); 270Assert.False(underlyingType.Equals(nativeIntegerType, SymbolEqualityComparer.ConsiderEverything));
Semantics\NullableReferenceTypesTests.cs (24)
157589Assert.True(field2.Equals(field3, SymbolEqualityComparer.Default)); 157590Assert.False(field2.Equals(field3, SymbolEqualityComparer.IncludeNullability)); 157591Assert.True(field3.Equals(field2, SymbolEqualityComparer.Default)); 157592Assert.False(field3.Equals(field2, SymbolEqualityComparer.IncludeNullability)); 157595Assert.True(field1.Equals(field2, SymbolEqualityComparer.Default)); 157596Assert.False(field1.Equals(field2, SymbolEqualityComparer.IncludeNullability)); 157597Assert.True(field2.Equals(field1, SymbolEqualityComparer.Default)); 157598Assert.False(field2.Equals(field1, SymbolEqualityComparer.IncludeNullability)); 157601Assert.True(field1.Equals(field3, SymbolEqualityComparer.Default)); 157602Assert.True(field1.Equals(field3, SymbolEqualityComparer.IncludeNullability)); 157603Assert.True(field3.Equals(field1, SymbolEqualityComparer.Default)); 157604Assert.True(field3.Equals(field1, SymbolEqualityComparer.IncludeNullability)); 157641Assert.False(method2.Equals(method3, SymbolEqualityComparer.Default)); 157642Assert.False(method2.Equals(method3, SymbolEqualityComparer.IncludeNullability)); 157643Assert.False(method3.Equals(method2, SymbolEqualityComparer.Default)); 157644Assert.False(method3.Equals(method2, SymbolEqualityComparer.IncludeNullability)); 157647Assert.False(method1.Equals(method2, SymbolEqualityComparer.Default)); 157648Assert.False(method1.Equals(method2, SymbolEqualityComparer.IncludeNullability)); 157649Assert.False(method2.Equals(method1, SymbolEqualityComparer.Default)); 157650Assert.False(method2.Equals(method1, SymbolEqualityComparer.IncludeNullability)); 157653Assert.True(method1.Equals(method3, SymbolEqualityComparer.Default)); 157654Assert.True(method1.Equals(method3, SymbolEqualityComparer.IncludeNullability)); 157655Assert.True(method3.Equals(method1, SymbolEqualityComparer.Default)); 157656Assert.True(method3.Equals(method1, SymbolEqualityComparer.IncludeNullability));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (10)
Symbols\Source\NullablePublicAPITests.cs (2)
2843Assert.True(event1.Equals(event2, SymbolEqualityComparer.Default)); 2844Assert.False(event1.Equals(event2, SymbolEqualityComparer.IncludeNullability));
Symbols\SymbolEqualityTests.cs (8)
980Assert.True(symbol1.Equals(symbol1, SymbolEqualityComparer.Default)); 981Assert.True(symbol2.Equals(symbol2, SymbolEqualityComparer.Default)); 982Assert.True(symbol1.Equals(symbol2, SymbolEqualityComparer.Default)); 983Assert.True(symbol2.Equals(symbol1, SymbolEqualityComparer.Default)); 986Assert.True(symbol1.Equals(symbol1, SymbolEqualityComparer.IncludeNullability)); 987Assert.True(symbol2.Equals(symbol2, SymbolEqualityComparer.IncludeNullability)); 988Assert.Equal(expectedIncludeNullability, symbol1.Equals(symbol2, SymbolEqualityComparer.IncludeNullability)); 989Assert.Equal(expectedIncludeNullability, symbol2.Equals(symbol1, SymbolEqualityComparer.IncludeNullability));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
Extensions.cs (4)
185return type.InstanceConstructors.Single(c => c.Parameters is [{ Type: var parameterType }] && parameterType.Equals(type, SymbolEqualityComparer.Default)); 203return type.GetMembers("Equals").OfType<IMethodSymbol>().Single(m => m.Parameters is [{ Type: var parameterType }] && parameterType.Equals(type, SymbolEqualityComparer.Default)); 216m.Parameters.All(p => p.RefKind == RefKind.Out && p.Type.Equals(primaryConstructor.Parameters[p.Ordinal].Type, SymbolEqualityComparer.Default))); 807return first.Equals(second, new Microsoft.CodeAnalysis.SymbolEqualityComparer(typeCompareKind));
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (8)
512if (originalConvertedType.Equals(rewrittenConvertedType, SymbolEqualityComparer.IncludeNullability)) 525rewrittenConvertedType.Equals(targetType, SymbolEqualityComparer.IncludeNullability)) 601if (originalConvertedType.Equals(castedType, SymbolEqualityComparer.IncludeNullability)) 616if (!originalNamedConvertedType.TypeArguments[0].Equals(namedCastedType.TypeArguments[0], SymbolEqualityComparer.IncludeNullability)) 795if (!originalConvertedType.Equals(rewrittenBitwiseNotConversionType, SymbolEqualityComparer.IncludeNullability)) 855if (!originalConditionalTypeInfo.ConvertedType!.Equals(rewrittenConditionalTypeInfo.ConvertedType, SymbolEqualityComparer.IncludeNullability)) 865if (castType.Equals(rewrittenConditionalOperation.Type, SymbolEqualityComparer.IncludeNullability)) 870castType.Equals(conditionalParentConversion.Type, SymbolEqualityComparer.IncludeNullability))
Microsoft.CodeAnalysis.Features (5)
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
117if (allAnonymousTypes || anonymousType.Equals(symbol, SymbolEqualityComparer.Default))
Shared\Utilities\ExtractTypeHelpers.cs (1)
231if (type.Equals(typeParameter, SymbolEqualityComparer.Default) ||
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (2)
144if (!targetTypeSymbol.Equals(enumerableType, SymbolEqualityComparer.Default) && 157=> whereMethod.Equals(invocation.TargetMethod.ReducedFrom ?? invocation.TargetMethod.OriginalDefinition, SymbolEqualityComparer.Default);
ValueTracking\ValueTracker.cs (1)
108var isParameterForPreviousTrackedMethod = previousSymbol?.Equals(parameterSymbol.ContainingSymbol, SymbolEqualityComparer.Default) == true;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
842Private Overloads Function ISymbol_Equals(other As ISymbol, equalityComparer As SymbolEqualityComparer) As Boolean Implements ISymbol.Equals
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Analyzers\VisualBasic\Analyzers\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationDiagnosticAnalyzer.vb (1)
56If symbolInfo.Type IsNot Nothing AndAlso symbolInfo.Type.Equals(symbolInfo.ConvertedType, SymbolEqualityComparer.Default) Then
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
CodeGen\CodeGenTuples.vb (1)
23213Assert.False(type.Equals(underlyingType, SymbolEqualityComparer.Default))
Microsoft.CodeAnalysis.VisualBasic.Features (1)
src\Analyzers\VisualBasic\Analyzers\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationDiagnosticAnalyzer.vb (1)
56If symbolInfo.Type IsNot Nothing AndAlso symbolInfo.Type.Equals(symbolInfo.ConvertedType, SymbolEqualityComparer.Default) Then
Microsoft.CodeAnalysis.Workspaces (6)
FindSymbols\FindReferences\Finders\AbstractTypeParameterSymbolReferenceFinder.cs (1)
63if (symbol.Equals(typeInfo.Type, SymbolEqualityComparer.Default))
FindSymbols\SymbolFinder_Helpers.cs (1)
81if (searchSymbol.Equals(symbolToMatch, SymbolEqualityComparer.Default))
Shared\Extensions\ITypeSymbolExtensions.cs (2)
197type.OriginalDefinition.Equals(asyncEnumerableType, SymbolEqualityComparer.Default)) 204if (@interface.OriginalDefinition.Equals(asyncEnumerableType, SymbolEqualityComparer.Default))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
234return method.Parameters.Any(static (p, within) => p.Type.Equals(within, SymbolEqualityComparer.Default), within);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (1)
67if (!symbolInfo.Symbol.Equals(newSymbolInfo.Symbol, SymbolEqualityComparer.IncludeNullability))
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
113if (attrCtorSymbol == null || !loggerMessageAttribute.Equals(attrCtorSymbol.ContainingType, SymbolEqualityComparer.Default))
Microsoft.Gen.Metrics (5)
Parser.cs (5)
226if (methodAttributeSymbol.Equals(symbols.CounterAttribute, SymbolEqualityComparer.Default)) 231if (methodAttributeSymbol.Equals(symbols.HistogramAttribute, SymbolEqualityComparer.Default)) 237if (methodAttributeSymbol.Equals(symbols.GaugeAttribute, SymbolEqualityComparer.Default)) 242if (methodAttributeSymbol.OriginalDefinition.Equals(symbols.CounterOfTAttribute, SymbolEqualityComparer.Default)) 247if (methodAttributeSymbol.OriginalDefinition.Equals(symbols.HistogramOfTAttribute, SymbolEqualityComparer.Default))
Microsoft.Gen.MetricsReports (5)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (5)
226if (methodAttributeSymbol.Equals(symbols.CounterAttribute, SymbolEqualityComparer.Default)) 231if (methodAttributeSymbol.Equals(symbols.HistogramAttribute, SymbolEqualityComparer.Default)) 237if (methodAttributeSymbol.Equals(symbols.GaugeAttribute, SymbolEqualityComparer.Default)) 242if (methodAttributeSymbol.OriginalDefinition.Equals(symbols.CounterOfTAttribute, SymbolEqualityComparer.Default)) 247if (methodAttributeSymbol.OriginalDefinition.Equals(symbols.HistogramOfTAttribute, SymbolEqualityComparer.Default))
Microsoft.Interop.ComInterfaceGenerator (12)
Analyzers\AddGeneratedComClassAnalyzer.cs (3)
36if (type.GetAttributes().Any(attr => generatedComClassAttributeType.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))) 49if (iface.GetAttributes().Any(attr => generatedComInterfaceAttributeType.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))) 57&& type.BaseType.GetAttributes().Any(attr => generatedComClassAttributeType.Equals(attr.AttributeClass, SymbolEqualityComparer.Default)))
Analyzers\ComHostingDoesNotSupportGeneratedComInterfaceAnalyzer.cs (3)
45|| !comVisibleAttribute.Equals(ctor.Type, SymbolEqualityComparer.Default) 53if (containingType.GetAttributes().Any(attr => generatedComClassAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))) 61if (iface.GetAttributes().Any(attr => generatedComInterfaceAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default)))
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
51AttributeData? interfaceTypeAttributeData = type.GetAttributes().FirstOrDefault(a => a.AttributeClass.Equals(interfaceTypeAttribute, SymbolEqualityComparer.Default));
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (1)
99var comImportAttribute = await declaringType.GetAttributes().First(attr => attr.AttributeClass.Equals(comImportAttributeType, SymbolEqualityComparer.Default)).ApplicationSyntaxReference.GetSyntaxAsync(ct).ConfigureAwait(false);
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (4)
37sourceGeneratedComRecognizers.Add(type => type.GetAttributes().Any(attr => generatedComClassAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))); 41sourceGeneratedComRecognizers.Add(type => type.GetAttributes().Any(attr => generatedComInterfaceAttribute.Equals(attr.AttributeClass, SymbolEqualityComparer.Default))); 45sourceGeneratedComRecognizers.Add(type => type.Equals(comObjectType, SymbolEqualityComparer.Default)); 186else if (operand is IInvocationOperation invocation && invocation.TargetMethod.Equals(getObjectForIUnknown, SymbolEqualityComparer.Default))
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (1)
646&& attrCreation.Type.Equals(_customMarshallerAttribute, SymbolEqualityComparer.Default))
Microsoft.Interop.SourceGeneration (1)
TypeSymbolExtensions.cs (1)
83if (t.ContainingAssembly.Equals(compilation.GetSpecialType(SpecialType.System_Object).ContainingAssembly, SymbolEqualityComparer.Default))
System.Private.CoreLib.Generators (9)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (9)
173if (attributeData.AttributeClass.Equals(bypassReadyToRunAttribute, SymbolEqualityComparer.Default)) 386if (attributeData.AttributeClass.Equals(compExactlyDependsOn, SymbolEqualityComparer.Default)) 406if (symbolOfInvokeTarget.ContainingSymbol.Equals(symbol, SymbolEqualityComparer.Default)) 411if (helperForType.Equals(symbol, SymbolEqualityComparer.Default)) 434if (namedTypeToCheckForSupport.Equals(symbol, SymbolEqualityComparer.Default)) 470(methodSymbol.ContainingType.Equals(symbol.ContainingSymbol, SymbolEqualityComparer.Default) 471|| (methodSymbol.ContainingType.ContainingType != null && methodSymbol.ContainingType.ContainingType.Equals(symbol.ContainingType, SymbolEqualityComparer.Default)))) 519if (attributeData.AttributeClass.Equals(compExactlyDependsOn, SymbolEqualityComparer.Default)) 527if (namespaceAttributeTypeSymbol.Equals(namespaceSymbol, SymbolEqualityComparer.Default))