614 references to Default
Aspire.Hosting.Analyzers (6)
AppHostAnalyzer.cs (4)
84SymbolEqualityComparer.Default.Equals(parameterData.Symbol.Type, wellKnownTypes.Get(SpecialType.System_String)) 109SymbolEqualityComparer.Default.Equals(a?.AttributeClass, resourceNameAttribute) 111: SymbolEqualityComparer.Default.Equals(a?.AttributeClass, endpointNameAttribute) 124if (SymbolEqualityComparer.Default.Equals(modelNameParameter, argument.Parameter))
Infrastructure\WellKnownTypes.cs (2)
117if (SymbolEqualityComparer.Default.Equals(type, Get(wellKnownType))) 150if (SymbolEqualityComparer.Default.Equals(t, interfaceType))
ConfigurationSchemaGenerator (46)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (29)
26private readonly Dictionary<ITypeSymbol, TypeSpec> _createdTypeSpecs = new(SymbolEqualityComparer.Default); 88if (SymbolEqualityComparer.Default.Equals(candidateBinderType, _typeSymbols.ConfigurationBinder)) 92else if (SymbolEqualityComparer.Default.Equals(candidateBinderType, _typeSymbols.OptionsBuilderConfigurationExtensions)) 96else if (SymbolEqualityComparer.Default.Equals(candidateBinderType, _typeSymbols.OptionsConfigurationServiceCollectionExtensions)) 201else if (SymbolEqualityComparer.Default.Equals(type, _typeSymbols.IConfigurationSection)) 295if (SymbolEqualityComparer.Default.Equals(type, _typeSymbols.CultureInfo)) 299else if (SymbolEqualityComparer.Default.Equals(type, _typeSymbols.DateTimeOffset) || 300SymbolEqualityComparer.Default.Equals(type, _typeSymbols.DateOnly) || 301SymbolEqualityComparer.Default.Equals(type, _typeSymbols.TimeOnly) || 302SymbolEqualityComparer.Default.Equals(type, _typeSymbols.TimeSpan)) 306else if (SymbolEqualityComparer.Default.Equals(type, _typeSymbols.Int128) || 307SymbolEqualityComparer.Default.Equals(type, _typeSymbols.Half) || 308SymbolEqualityComparer.Default.Equals(type, _typeSymbols.UInt128)) 312else if (SymbolEqualityComparer.Default.Equals(type, _typeSymbols.Uri)) 316else if (SymbolEqualityComparer.Default.Equals(type, _typeSymbols.Version) || 317SymbolEqualityComparer.Default.Equals(type, _typeSymbols.Guid)) 547if (SymbolEqualityComparer.Default.Equals(_typeSymbols.IntPtr, type) || 548SymbolEqualityComparer.Default.Equals(_typeSymbols.UIntPtr, type) || 549SymbolEqualityComparer.Default.Equals(_typeSymbols.SerializationInfo, type) || 550SymbolEqualityComparer.Default.Equals(_typeSymbols.ParameterInfo, type) || 674AttributeData? attributeData = property.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, _typeSymbols.ConfigurationKeyNameAttribute)); 810&& SymbolEqualityComparer.Default.Equals(unbound, @interface)); 813return type.AllInterfaces.FirstOrDefault(candidate => SymbolEqualityComparer.Default.Equals(candidate, @interface)); 826return SymbolEqualityComparer.Default.Equals(unbound, @interface); 829return SymbolEqualityComparer.Default.Equals(type, @interface); 861SymbolEqualityComparer.Default.Equals(element, method.Parameters[0].Type))) 877SymbolEqualityComparer.Default.Equals(key, method.Parameters[0].Type) && 878SymbolEqualityComparer.Default.Equals(element, method.Parameters[1].Type))) 963&& secondParam.Name == "paramName" && secondParam.Type.Equals(_typeSymbols.String, SymbolEqualityComparer.Default))
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (6)
45if (!SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, @params[0].Type)) 62else if (SymbolEqualityComparer.Default.Equals(@params[2].Type, _typeSymbols.ActionOfBinderOptions)) 140if (!SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, @params[0].Type)) 161else if (paramCount is 2 && SymbolEqualityComparer.Default.Equals(@params[1].Type, _typeSymbols.ActionOfBinderOptions)) 179else if (paramCount is 3 && SymbolEqualityComparer.Default.Equals(@params[2].Type, _typeSymbols.ActionOfBinderOptions)) 211else if (paramCount is 3 && SymbolEqualityComparer.Default.Equals(@params[2].Type, type))
RuntimeSource\Configuration.Binder\Parser\OptionsBuilderConfigurationExtensions.cs (4)
23!SymbolEqualityComparer.Default.Equals(_typeSymbols.OptionsBuilderOfT_Unbound, genericType.ConstructUnboundGenericType())) 51if (!SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, @params[1].Type)) 593 when SymbolEqualityComparer.Default.Equals(_typeSymbols.ActionOfBinderOptions, @params[2].Type) => 80SymbolEqualityComparer.Default.Equals(_typeSymbols.ActionOfBinderOptions, @params[2].Type))
RuntimeSource\Configuration.Binder\Parser\OptionsConfigurationServiceCollectionExtensions.cs (7)
23!SymbolEqualityComparer.Default.Equals(_typeSymbols.IServiceCollection, @params[0].Type)) 35if (paramCount is 2 && SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, @params[1].Type)) 45SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, thirdParamType)) 49else if (SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, secondParamType) && 50SymbolEqualityComparer.Default.Equals(_typeSymbols.ActionOfBinderOptions, thirdParamType)) 61SymbolEqualityComparer.Default.Equals(_typeSymbols.IConfiguration, @params[2].Type) && 62SymbolEqualityComparer.Default.Equals(_typeSymbols.ActionOfBinderOptions, @params[3].Type))
ILLink.RoslynAnalyzer (24)
DataFlow\DynamicallyAccessedMembersBinder.cs (1)
375 public static void GetAllOnType (this ITypeSymbol type, bool declaredOnly, List<ISymbol> members) => GetAllOnType (type, declaredOnly, members, new HashSet<ITypeSymbol> (SymbolEqualityComparer.Default));
DataFlow\LocalStateLattice.cs (2)
21 public bool Equals (LocalKey other) => SymbolEqualityComparer.Default.Equals (Local, other.Local) && 28 => CaptureId is null ? SymbolEqualityComparer.Default.GetHashCode (Local) : CaptureId.GetHashCode ();
DataFlow\MethodBodyValue.cs (1)
40 public override int GetHashCode () => SymbolEqualityComparer.Default.GetHashCode (OwningSymbol);
DynamicallyAccessedMembersAnalyzer.cs (1)
271 if (!implementationType.IsInterface () && !SymbolEqualityComparer.Default.Equals (implementationType, type))
ISymbolExtensions.cs (2)
212 SymbolEqualityComparer.Default.Equals(methodSymbol.ReturnType.OriginalDefinition, compilation.TaskType()) || 213 SymbolEqualityComparer.Default.Equals(methodSymbol.ReturnType.OriginalDefinition, compilation.TaskOfTType()));
RequiresAnalyzerBase.cs (2)
147 if (!implementationType.IsInterface () && !SymbolEqualityComparer.Default.Equals (implementationType, type)) 172 while (member is IMethodSymbol method && method.OverriddenMethod != null && SymbolEqualityComparer.Default.Equals (method.ReturnType, method.OverriddenMethod.ReturnType))
RequiresAssemblyFilesAnalyzer.cs (3)
80 return SymbolEqualityComparer.Default.Equals (propertySymbol, isDynamicCodeSupportedProperty); 112 if (ImmutableArrayOperations.Contains (dangerousPatterns, member, SymbolEqualityComparer.Default)) { 117 ImmutableArrayOperations.Contains (dangerousPatterns, associatedSymbol, SymbolEqualityComparer.Default)) {
RequiresDynamicCodeAnalyzer.cs (1)
139 return SymbolEqualityComparer.Default.Equals (propertySymbol, isDynamicCodeSupportedProperty);
RequiresUnreferencedCodeAnalyzer.cs (1)
82 return SymbolEqualityComparer.Default.Equals (propertySymbol, isDynamicCodeSupportedProperty);
TrimAnalysis\ReflectionAccessAnalyzer.cs (1)
123 if (SymbolEqualityComparer.Default.Equals (containingType, type))
TrimAnalysis\TrimAnalysisAssignmentPattern.cs (1)
46 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisFieldAccessPattern.cs (2)
36 Debug.Assert (SymbolEqualityComparer.Default.Equals (Field, other.Field)); 38 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisGenericInstantiationPattern.cs (2)
36 Debug.Assert (SymbolEqualityComparer.Default.Equals (GenericInstantiation, other.GenericInstantiation)); 37 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisMethodCallPattern.cs (2)
55 Debug.Assert (SymbolEqualityComparer.Default.Equals (CalledMethod, other.CalledMethod)); 56 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisReflectionAccessPattern.cs (2)
35 Debug.Assert (SymbolEqualityComparer.Default.Equals (ReferencedMethod, other.ReferencedMethod)); 37 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
Microsoft.Analyzers.Extra (34)
AsyncCallInsideUsingBlockAnalyzer.cs (5)
137return SymbolEqualityComparer.Default.Equals(returnType, taskType) || 138SymbolEqualityComparer.Default.Equals(returnType, taskOfTType) || 139SymbolEqualityComparer.Default.Equals(returnType, valueTaskType) || 140SymbolEqualityComparer.Default.Equals(returnType, valueTaskOfTType); 194return SymbolEqualityComparer.Default.Equals(localReference.Local, symbol);
AsyncMethodWithoutCancellation.cs (7)
49var knownTypes = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 117return SymbolEqualityComparer.Default.Equals(returnType, taskType) || 118SymbolEqualityComparer.Default.Equals(returnType, taskOfTType) || 119SymbolEqualityComparer.Default.Equals(returnType, valueTaskType) || 120SymbolEqualityComparer.Default.Equals(returnType, valueTaskOfTType); 133SymbolEqualityComparer.Default.Equals(data.AttributeClass, obsoleteAttribute)); 145.Any(implementation => SymbolEqualityComparer.Default.Equals(implementation, method)))
CallAnalysis\Arrays.cs (1)
115if (keyType.GetAttributes().Any(a => a.AttributeClass != null && SymbolEqualityComparer.Default.Equals(a.AttributeClass, flagsAttr)))
CallAnalysis\CallAnalyzer.Handlers.cs (2)
48if (SymbolEqualityComparer.Default.Equals(target, h.Method)) 67if (SymbolEqualityComparer.Default.Equals(target, impl))
CallAnalysis\CallAnalyzer.Registrar.cs (1)
176if (SymbolEqualityComparer.Default.Equals(h.Method, method))
CallAnalysis\CallAnalyzer.State.cs (5)
16public readonly Dictionary<IMethodSymbol, List<Action<OperationAnalysisContext, IInvocationOperation>>> Methods = new(SymbolEqualityComparer.Default); 17public readonly Dictionary<IMethodSymbol, List<Action<OperationAnalysisContext, IObjectCreationOperation>>> Ctors = new(SymbolEqualityComparer.Default); 18public readonly Dictionary<IPropertySymbol, List<Action<OperationAnalysisContext, IPropertyReferenceOperation>>> Props = new(SymbolEqualityComparer.Default); 19public readonly Dictionary<ITypeSymbol, List<Action<OperationAnalysisContext, IThrowOperation>>> ExceptionTypes = new(SymbolEqualityComparer.Default); 20public readonly Dictionary<ITypeSymbol, List<MethodHandlers>> Interfaces = new(SymbolEqualityComparer.Default);
CallAnalysis\Fixers\LegacyLoggingFixer.cs (4)
185matchParams = invocationArgList[i].Equals(methodSymbol.Parameters[i].Type, SymbolEqualityComparer.Default); 200if (SymbolEqualityComparer.Default.Equals(methodAttr.AttributeClass, logMethodAttribute) && 249if (SymbolEqualityComparer.Default.Equals(ctorArg.Type, param.Type)) 639if (SymbolEqualityComparer.Default.Equals(methodAttr.AttributeClass, logMethodAttribute) &&
CallAnalysis\StartsEndsWith.cs (4)
23.Where(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, stringType)) 26(m.Parameters.Length == 2 && SymbolEqualityComparer.Default.Equals(m.Parameters[1].Type, stringCompType))); 29.Where(m => SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, stringType)) 32(m.Parameters.Length == 2 && SymbolEqualityComparer.Default.Equals(m.Parameters[1].Type, stringCompType)));
ConditionalAccessAnalyzer.cs (1)
121if (SymbolEqualityComparer.Default.Equals(attr.AttributeClass, maybeNull))
MakeExeTypesInternalAnalyzer.cs (2)
59var disqualifyingMemberAttributes = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 69var disqualifyingTypeAttributes = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
Utilities\SymbolExtensions.cs (2)
27if (SymbolEqualityComparer.Default.Equals(t, potentialAncestor)) 70if (SymbolEqualityComparer.Default.Equals(impl, method))
Microsoft.Analyzers.Local (14)
ApiLifecycle\AssemblyAnalysis.cs (3)
17public Dictionary<ISymbol, List<string>> MissingConstraints { get; } = new(SymbolEqualityComparer.Default); 18public Dictionary<ISymbol, List<string>> MissingBaseTypes { get; } = new(SymbolEqualityComparer.Default); 23public HashSet<ISymbol> NotFoundInBaseline { get; } = new(SymbolEqualityComparer.Default);
CallAnalysis\CallAnalyzer.Handlers.cs (2)
48if (SymbolEqualityComparer.Default.Equals(target, h.Method)) 67if (SymbolEqualityComparer.Default.Equals(target, impl))
CallAnalysis\CallAnalyzer.Registrar.cs (1)
176if (SymbolEqualityComparer.Default.Equals(h.Method, method))
CallAnalysis\CallAnalyzer.State.cs (5)
16public readonly Dictionary<IMethodSymbol, List<Action<OperationAnalysisContext, IInvocationOperation>>> Methods = new(SymbolEqualityComparer.Default); 17public readonly Dictionary<IMethodSymbol, List<Action<OperationAnalysisContext, IObjectCreationOperation>>> Ctors = new(SymbolEqualityComparer.Default); 18public readonly Dictionary<IPropertySymbol, List<Action<OperationAnalysisContext, IPropertyReferenceOperation>>> Props = new(SymbolEqualityComparer.Default); 19public readonly Dictionary<ITypeSymbol, List<Action<OperationAnalysisContext, IThrowOperation>>> ExceptionTypes = new(SymbolEqualityComparer.Default); 20public readonly Dictionary<ITypeSymbol, List<MethodHandlers>> Interfaces = new(SymbolEqualityComparer.Default);
CallAnalysis\ToInvariantString.cs (2)
32if (method.Parameters.Length == 1 && SymbolEqualityComparer.Default.Equals(method.Parameters[0].Type, formatProvider)) 49if (SymbolEqualityComparer.Default.Equals(invariantCulture, prop.Property))
Utilities\SymbolExtensions.cs (1)
41if (SymbolEqualityComparer.Default.Equals(a.AttributeClass, attribute))
Microsoft.AspNetCore.Analyzers (7)
MiddlewareAnalyzer.cs (1)
36SymbolEqualityComparer.Default.Equals(invocation.Arguments[0].Parameter?.Type, _context.StartupSymbols.IApplicationBuilder))
ServicesAnalyzer.cs (1)
31SymbolEqualityComparer.Default.Equals(invocation.Arguments[0].Parameter?.Type, _context.StartupSymbols.IServiceCollection))
StartupAnalysisBuilder.cs (1)
22_analysesByType = new Dictionary<INamedTypeSymbol, List<object>>(SymbolEqualityComparer.Default);
StartupAnalyzer.cs (2)
44if (!StartupFacts.IsStartupClass(symbols, type) && !SymbolEqualityComparer.Default.Equals(entryPoint?.ContainingType, type)) 73var isMain = SymbolEqualityComparer.Default.Equals(entryPoint, context.OwningSymbol);
StartupFacts.cs (2)
77return SymbolEqualityComparer.Default.Equals(symbol.Parameters[0].Type, symbols.IServiceCollection); 112if (SymbolEqualityComparer.Default.Equals(symbol.Parameters[i].Type, symbols.IApplicationBuilder))
Microsoft.AspNetCore.App.Analyzers (68)
Authorization\AddAuthorizationBuilderAnalyzer.cs (13)
57if (SymbolEqualityComparer.Default.Equals(invocation.TargetMethod, addAuthorizationMethod) 58&& SymbolEqualityComparer.Default.Equals(invocation.TargetMethod.ContainingType, policyServiceCollectionExtensions) 148&& SymbolEqualityComparer.Default.Equals(propertyReferenceContainingType, authorizationOptionsTypes.AuthorizationOptions)) 154&& SymbolEqualityComparer.Default.Equals(invokedMethodContainingType, authorizationOptionsTypes.AuthorizationOptions)) 180&& SymbolEqualityComparer.Default.Equals(property, targetProperty.Property)) 185&& SymbolEqualityComparer.Default.Equals(property, valueProperty.Property)) 193if (SymbolEqualityComparer.Default.Equals(property, authorizationOptionsTypes.DefaultPolicy) 194|| SymbolEqualityComparer.Default.Equals(property, authorizationOptionsTypes.FallbackPolicy) 195|| SymbolEqualityComparer.Default.Equals(property, authorizationOptionsTypes.InvokeHandlersAfterFailure)) 207&& SymbolEqualityComparer.Default.Equals(methodReferenceOperation.Member, authorizationOptionsTypes.GetPolicy) 208&& SymbolEqualityComparer.Default.Equals(methodReferenceOperation.Member.ContainingType, authorizationOptionsTypes.AuthorizationOptions)) 214&& SymbolEqualityComparer.Default.Equals(invocationOperation.TargetMethod, authorizationOptionsTypes.GetPolicy) 215&& SymbolEqualityComparer.Default.Equals(invocationOperation.TargetMethod.ContainingType, authorizationOptionsTypes.AuthorizationOptions))
Http\HeaderDictionaryAddAnalyzer.cs (1)
36&& SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IHeaderDictionary), invocation.Instance?.Type))
Http\RequestDelegateReturnTypeAnalyzer.cs (4)
33SymbolEqualityComparer.Default.Equals(parent.Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_RequestDelegate))) 38if (SymbolEqualityComparer.Default.Equals(returnType.OriginalDefinition, wellKnownTypes.Get(WellKnownType.System_Threading_Tasks_Task_T))) 49SymbolEqualityComparer.Default.Equals(parent.Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_RequestDelegate))) 64if (returnType != null && SymbolEqualityComparer.Default.Equals(returnType.OriginalDefinition, wellKnownTypes.Get(WellKnownType.System_Threading_Tasks_Task_T)))
Mvc\DetectAmbiguousActionRoutes.cs (1)
151if (SymbolEqualityComparer.Default.Equals(actionSymbol1, actionSymbol2))
Mvc\DetectOverriddenAuthorizeAttribute.cs (1)
112private static bool IsSameSymbol(ISymbol? x, ISymbol? y) => SymbolEqualityComparer.Default.Equals(x, y);
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (1)
60=> SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Components_Rendering_RenderTreeBuilder), targetMethod.ContainingType)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
374if (SymbolEqualityComparer.Default.Equals(attributeTypeSymbol.ContainingSymbol, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_AsParametersAttribute)))
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (3)
156if (SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_EndpointRouteBuilderExtensions), mapMethodSymbol.ContainingType)) 270a => SymbolEqualityComparer.Default.Equals(a.Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Routing_IEndpointRouteBuilder)) || 291var routeStringParameter = method.Parameters.FirstOrDefault(p => SymbolEqualityComparer.Default.Equals(stringSymbol, p.Type) &&
RouteEmbeddedLanguage\RoutePatternHighlighter.cs (1)
99.Where(i => semanticModel.GetSymbolInfo(i) is var symbolInfo && SymbolEqualityComparer.Default.Equals(symbolInfo.Symbol ?? symbolInfo.CandidateSymbols.FirstOrDefault(), matchingParameter));
RouteHandlers\DetectAmbiguousRoutes.cs (12)
97if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_RoutingEndpointConventionBuilderExtensions))) 109else if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_AuthorizationEndpointConventionBuilderExtensions))) 113else if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_OpenApiRouteHandlerBuilderExtensions))) 128else if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_CorsEndpointConventionBuilderExtensions))) 132else if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_DependencyInjection_OutputCacheConventionBuilderExtensions))) 136else if (SymbolEqualityComparer.Default.Equals(method.ContainingType, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_RateLimiterEndpointConventionBuilderExtensions))) 185return SymbolEqualityComparer.Default.Equals(local.Local, otherLocal.Local); 191return SymbolEqualityComparer.Default.Equals(parameter.Parameter, otherParameter.Parameter); 198SymbolEqualityComparer.Default.Equals(invocation.TargetMethod, otherInvocation.TargetMethod) && 244if (!SymbolEqualityComparer.Default.Equals(local.Local, otherLocal.Local)) 251if (!SymbolEqualityComparer.Default.Equals(parameter.Parameter, otherParameter.Parameter)) 275if (SymbolEqualityComparer.Default.Equals(arguments[i].Parameter, parameter))
RouteHandlers\RouteHandlerAnalyzer.cs (3)
201SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Builder_EndpointRouteBuilderExtensions), targetMethod.ContainingType) && 209if (SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.System_Delegate), parmeterType)) 213if (SymbolEqualityComparer.Default.Equals(wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_RequestDelegate), parmeterType))
src\Shared\Roslyn\CodeAnalysisExtensions.cs (5)
102if (SymbolEqualityComparer.Default.Equals(source, target)) 111if (SymbolEqualityComparer.Default.Equals(source, @interface)) 122if (SymbolEqualityComparer.Default.Equals(source, type)) 159Debug.Assert(method.PartialImplementationPart == null && !SymbolEqualityComparer.Default.Equals(method.PartialDefinitionPart, method)); 165Debug.Assert(!SymbolEqualityComparer.Default.Equals(method.PartialImplementationPart, method));
src\Shared\Roslyn\MvcFacts.cs (1)
143return SymbolEqualityComparer.Default.Equals(implementedMethod, method);
src\Shared\RoslynUtils\ParsabilityHelper.cs (12)
33if (SymbolEqualityComparer.Default.Equals(typeSymbol, wellKnownTypes.Get(WellKnownType.System_Uri))) 111SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[1].Type, wellKnownTypes.Get(WellKnownType.System_IFormatProvider)) && 119i => SymbolEqualityComparer.Default.Equals(i.ConstructedFrom, iParsableTypeSymbol) 128i => SymbolEqualityComparer.Default.Equals(i.ConstructedFrom, iBindableFromHttpContextTypeSymbol) 131SymbolEqualityComparer.Default.Equals(constructedTypeSymbol.TypeArguments[0].UnwrapTypeSymbol(unwrapNullable: true), typeSymbol); 139SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[0].Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpContext)) && 141SymbolEqualityComparer.Default.Equals(returnType.ConstructedFrom, wellKnownTypes.Get(WellKnownType.System_Threading_Tasks_ValueTask_T)) && 142SymbolEqualityComparer.Default.Equals(returnType.TypeArguments[0], typeSymbol); 150SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[0].Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpContext)) && 151SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[1].Type, wellKnownTypes.Get(WellKnownType.System_Reflection_ParameterInfo)) && 158return SymbolEqualityComparer.Default.Equals(returnType.ConstructedFrom, wellKnownTypes.Get(WellKnownType.System_Threading_Tasks_ValueTask_T)) && 159SymbolEqualityComparer.Default.Equals(returnType.TypeArguments[0].UnwrapTypeSymbol(unwrapNullable: true), containingType);
src\Shared\RoslynUtils\SymbolExtensions.cs (5)
56if (SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, attributeType)) 74if (SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, attributeType)) 129if (SymbolEqualityComparer.Default.Equals(t, interfaceType)) 138=> SymbolEqualityComparer.Default.Equals(type, semanticModel.Compilation.GetTypeByMetadataName(typeName)); 141=> SymbolEqualityComparer.Default.Equals(type, otherType);
src\Shared\RoslynUtils\WellKnownTypes.cs (2)
122if (SymbolEqualityComparer.Default.Equals(type, Get(wellKnownType))) 155if (SymbolEqualityComparer.Default.Equals(t, interfaceType))
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (2)
326if (!SymbolEqualityComparer.Default.Equals(receiverType, disallowedReceiverType)) 352if (SymbolEqualityComparer.Default.Equals(type, methodSymbol.ContainingType))
Microsoft.AspNetCore.App.CodeFixes (3)
Dependencies\ExtensionMethodsCompletionProvider.cs (1)
115return SymbolEqualityComparer.Default.Equals(pair.Key.ThisType, symbolType) &&
Dependencies\ThisAndExtensionMethod.cs (2)
16SymbolEqualityComparer.Default.Equals(ThisType, other.ThisType) && 22return HashCode.Combine(SymbolEqualityComparer.Default.GetHashCode(ThisType), ExtensionMethod);
Microsoft.AspNetCore.Components.Analyzers (8)
ComponentFacts.cs (5)
27return SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute) || SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.CascadingParameterAttribute); 43return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute)); 58var attribute = property.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute)); 87return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.CascadingParameterAttribute));
ComponentParameterAnalyzer.cs (1)
147.Any(f => f.IsImplicitlyDeclared && SymbolEqualityComparer.Default.Equals(propertySymbol, f.AssociatedSymbol));
InternalUsageAnalyzer.cs (2)
129if (symbol == null || SymbolEqualityComparer.Default.Equals(symbol.ContainingAssembly, context.Compilation.Assembly)) 158if (symbol == null || SymbolEqualityComparer.Default.Equals(symbol.ContainingAssembly, context.Compilation.Assembly))
Microsoft.AspNetCore.Components.SdkAnalyzers (7)
ComponentFacts.cs (5)
27return SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute) || SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.CascadingParameterAttribute); 43return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute)); 58var attribute = property.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.ParameterAttribute)); 87return property.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, symbols.CascadingParameterAttribute));
InternalUsageAnalyzer.cs (2)
129if (symbol == null || SymbolEqualityComparer.Default.Equals(symbol.ContainingAssembly, context.Compilation.Assembly)) 158if (symbol == null || SymbolEqualityComparer.Default.Equals(symbol.ContainingAssembly, context.Compilation.Assembly))
Microsoft.AspNetCore.Http.RequestDelegateGenerator (50)
src\Shared\RoslynUtils\ParsabilityHelper.cs (12)
33if (SymbolEqualityComparer.Default.Equals(typeSymbol, wellKnownTypes.Get(WellKnownType.System_Uri))) 111SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[1].Type, wellKnownTypes.Get(WellKnownType.System_IFormatProvider)) && 119i => SymbolEqualityComparer.Default.Equals(i.ConstructedFrom, iParsableTypeSymbol) 128i => SymbolEqualityComparer.Default.Equals(i.ConstructedFrom, iBindableFromHttpContextTypeSymbol) 131SymbolEqualityComparer.Default.Equals(constructedTypeSymbol.TypeArguments[0].UnwrapTypeSymbol(unwrapNullable: true), typeSymbol); 139SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[0].Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpContext)) && 141SymbolEqualityComparer.Default.Equals(returnType.ConstructedFrom, wellKnownTypes.Get(WellKnownType.System_Threading_Tasks_ValueTask_T)) && 142SymbolEqualityComparer.Default.Equals(returnType.TypeArguments[0], typeSymbol); 150SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[0].Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpContext)) && 151SymbolEqualityComparer.Default.Equals(methodSymbol.Parameters[1].Type, wellKnownTypes.Get(WellKnownType.System_Reflection_ParameterInfo)) && 158return SymbolEqualityComparer.Default.Equals(returnType.ConstructedFrom, wellKnownTypes.Get(WellKnownType.System_Threading_Tasks_ValueTask_T)) && 159SymbolEqualityComparer.Default.Equals(returnType.TypeArguments[0].UnwrapTypeSymbol(unwrapNullable: true), containingType);
src\Shared\RoslynUtils\SymbolExtensions.cs (5)
56if (SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, attributeType)) 74if (SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, attributeType)) 129if (SymbolEqualityComparer.Default.Equals(t, interfaceType)) 138=> SymbolEqualityComparer.Default.Equals(type, semanticModel.Compilation.GetTypeByMetadataName(typeName)); 141=> SymbolEqualityComparer.Default.Equals(type, otherType);
src\Shared\RoslynUtils\WellKnownTypes.cs (2)
122if (SymbolEqualityComparer.Default.Equals(type, Get(wellKnownType))) 155if (SymbolEqualityComparer.Default.Equals(t, interfaceType))
StaticRouteHandlerModel\Endpoint.cs (1)
144hashCode.Add(parameter.Type, SymbolEqualityComparer.Default);
StaticRouteHandlerModel\EndpointParameter.cs (19)
95if (SymbolEqualityComparer.Default.Equals(Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IFormFileCollection))) 100else if (SymbolEqualityComparer.Default.Equals(Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IFormFile))) 105else if (SymbolEqualityComparer.Default.Equals(Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IFormCollection))) 129if (SymbolEqualityComparer.Default.Equals(Type, wellKnownTypes.Get(WellKnownType.System_IO_Stream))) 134else if (SymbolEqualityComparer.Default.Equals(Type, wellKnownTypes.Get(WellKnownType.System_IO_Pipelines_PipeReader))) 196else if (SymbolEqualityComparer.Default.Equals(Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IFormFileCollection))) 203else if (SymbolEqualityComparer.Default.Equals(Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IFormFile))) 210else if (SymbolEqualityComparer.Default.Equals(Type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_IFormCollection))) 234else if (SymbolEqualityComparer.Default.Equals(Type, wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_Primitives_StringValues))) 260=> SymbolEqualityComparer.Default.Equals(Type, wellKnownTypes.Get(WellKnownType.Microsoft_Extensions_Primitives_StringValues)) 361else if (SymbolEqualityComparer.Default.Equals(parameterType, wellKnownTypes.Get(WellKnownType.System_DateTimeOffset))) 365else if (SymbolEqualityComparer.Default.Equals(parameterType, wellKnownTypes.Get(WellKnownType.System_DateOnly))) 383if (SymbolEqualityComparer.Default.Equals(type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpContext))) 388if (SymbolEqualityComparer.Default.Equals(type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpRequest))) 393if (SymbolEqualityComparer.Default.Equals(type, wellKnownTypes.Get(WellKnownType.Microsoft_AspNetCore_Http_HttpResponse))) 398if (SymbolEqualityComparer.Default.Equals(type, wellKnownTypes.Get(WellKnownType.System_IO_Pipelines_PipeReader))) 403if (SymbolEqualityComparer.Default.Equals(type, wellKnownTypes.Get(WellKnownType.System_IO_Stream))) 408if (SymbolEqualityComparer.Default.Equals(type, wellKnownTypes.Get(WellKnownType.System_Security_Claims_ClaimsPrincipal))) 413if (SymbolEqualityComparer.Default.Equals(type, wellKnownTypes.Get(WellKnownType.System_Threading_CancellationToken)))
StaticRouteHandlerModel\EndpointResponse.cs (9)
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)) 83SymbolEqualityComparer.Default.Equals(ResponseType, resultType); 104SymbolEqualityComparer.Default.Equals(otherEndpointResponse.ResponseType, ResponseType) && 105SymbolEqualityComparer.Default.Equals(otherEndpointResponse.WrappedResponseType, WrappedResponseType) && 114HashCode.Combine(SymbolEqualityComparer.Default.GetHashCode(ResponseType), SymbolEqualityComparer.Default.GetHashCode(WrappedResponseType), WrappedResponseTypeDisplayName, IsAwaitable, HasNoResponse, IsIResult, ContentType);
StaticRouteHandlerModel\InvocationOperationExtensions.cs (1)
34SymbolEqualityComparer.Default.Equals(delegateType, wellKnownTypes.Get(WellKnownTypeData.WellKnownType.System_Delegate)))
StaticRouteHandlerModel\Model\ParameterLookupKey.cs (1)
30return SymbolEqualityComparer.Default.Equals(Type, other.Type) &&
Microsoft.AspNetCore.Mvc.Analyzers (9)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (5)
102if (SymbolEqualityComparer.Default.Equals(source, target)) 111if (SymbolEqualityComparer.Default.Equals(source, @interface)) 122if (SymbolEqualityComparer.Default.Equals(source, type)) 159Debug.Assert(method.PartialImplementationPart == null && !SymbolEqualityComparer.Default.Equals(method.PartialDefinitionPart, method)); 165Debug.Assert(!SymbolEqualityComparer.Default.Equals(method.PartialImplementationPart, method));
src\Shared\Roslyn\MvcFacts.cs (1)
143return SymbolEqualityComparer.Default.Equals(implementedMethod, method);
TagHelpersInCodeBlocksAnalyzer.cs (1)
105if (!SymbolEqualityComparer.Default.Equals(method, symbolCache.TagHelperRunnerRunAsyncMethodSymbol))
TopLevelParameterNameAnalyzer.cs (1)
155var nameProperty = SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, symbolCache.BindAttribute) ? "Prefix" : "Name";
ViewFeaturesAnalyzerContext.cs (1)
35if (!SymbolEqualityComparer.Default.Equals(method.ContainingType, HtmlHelperPartialExtensionsType))
Microsoft.AspNetCore.Mvc.Api.Analyzers (12)
ActualApiResponseMetadataFactory.cs (2)
268if (SymbolEqualityComparer.Default.Equals(property.ExplicitInterfaceImplementations[i], statusCodeActionResultStatusProperty)) 275return SymbolEqualityComparer.Default.Equals(implementedProperty, property);
AddResponseTypeAttributeCodeFixAction.cs (3)
75if (statusCode >= 400 && returnType != null && !SymbolEqualityComparer.Default.Equals(returnType, errorResponseType)) 89if (!declaredResponseMetadata.Any(m => m.IsDefault && SymbolEqualityComparer.Default.Equals(m.AttributeSource, context.Method))) 183SymbolEqualityComparer.Default.Equals(declaredMetadata.AttributeSource, context.Method))
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (1)
193if (!SymbolEqualityComparer.Default.Equals(propertyReference.Member.ContainingType, symbolCache.ModelStateDictionary))
src\Shared\Roslyn\CodeAnalysisExtensions.cs (5)
102if (SymbolEqualityComparer.Default.Equals(source, target)) 111if (SymbolEqualityComparer.Default.Equals(source, @interface)) 122if (SymbolEqualityComparer.Default.Equals(source, type)) 159Debug.Assert(method.PartialImplementationPart == null && !SymbolEqualityComparer.Default.Equals(method.PartialDefinitionPart, method)); 165Debug.Assert(!SymbolEqualityComparer.Default.Equals(method.PartialImplementationPart, method));
src\Shared\Roslyn\MvcFacts.cs (1)
143return SymbolEqualityComparer.Default.Equals(implementedMethod, method);
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (3)
HubClientProxyGenerator.Parser.cs (2)
89if (!SymbolEqualityComparer.Default.Equals(symbol.TypeArguments[0], symbol.Parameters[1].Type)) 290.Select(member => (IMethodSymbol)member)), SymbolEqualityComparer.Default).ToList();
HubServerProxyGenerator.Parser.cs (1)
80if (!SymbolEqualityComparer.Default.Equals(symbol.TypeArguments[0], symbol.ReturnType))
Microsoft.CodeAnalysis (1)
Symbols\SymbolEqualityComparer.cs (1)
28/// Comparing <c>string</c> and <c>string?</c> will not return equal. Use <see cref="Default"/> if you want them to be considered equal.
Microsoft.CodeAnalysis.CodeStyle (11)
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (1)
126hasUnderlyingTypeArm |= SymbolEqualityComparer.Default.Equals(
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (1)
201hasUnderlyingTypeCase |= SymbolEqualityComparer.Default.Equals(
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
493if (SymbolEqualityComparer.Default.Equals(entryPoint, member)) 856if (_iNotifyCompletionType != null && Roslyn.Utilities.ImmutableArrayExtensions.Contains(methodSymbol.ContainingType.AllInterfaces, _iNotifyCompletionType, SymbolEqualityComparer.Default)
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
172=> SymbolEqualityComparer.Default.Equals(type, FindType<T>(semanticModel));
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (4)
158if (!targetTypeSymbol.Equals(enumerableType, SymbolEqualityComparer.Default)) 178=> whereMethodSymbol.Equals(invocation.TargetMethod.ReducedFrom ?? invocation.TargetMethod.OriginalDefinition, SymbolEqualityComparer.Default); 181=> selectMethodSymbol.Equals(invocation.TargetMethod.ReducedFrom ?? invocation.TargetMethod.OriginalDefinition, SymbolEqualityComparer.Default); 184=> linqMethods.Any(static (m, invocation) => m.Equals(invocation.TargetMethod.ReducedFrom ?? invocation.TargetMethod.OriginalDefinition, SymbolEqualityComparer.Default), invocation);
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
83if (SymbolEqualityComparer.Default.Equals(firstType, secondType))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
236return method.Parameters.Any(static (p, within) => p.Type.Equals(within, SymbolEqualityComparer.Default), within);
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (1)
48var result = capturedTypeParameters.Except<ITypeParameterSymbol>(availableTypeParameters, SymbolEqualityComparer.Default).ToImmutableArray();
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
183var result = new Dictionary<ITypeSymbol, ITypeParameterSymbol>(SymbolEqualityComparer.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (2)
56var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>(SymbolEqualityComparer.Default); 110var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>(SymbolEqualityComparer.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
394return memberType.AllInterfaces.Contains(constructed, equalityComparer: SymbolEqualityComparer.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
134SymbolEqualityComparer.Default.Equals(returnType, valueTaskType)) is IMethodSymbol disposeMethodFromPattern)
Microsoft.CodeAnalysis.CSharp (5)
Symbols\PublicModel\ArrayTypeSymbol.cs (1)
68return this.Equals(other as ArrayTypeSymbol, CodeAnalysis.SymbolEqualityComparer.Default);
Symbols\PublicModel\Symbol.cs (2)
86return this.Equals(obj as Symbol, CodeAnalysis.SymbolEqualityComparer.Default); 91return this.Equals(other as Symbol, CodeAnalysis.SymbolEqualityComparer.Default);
Symbols\Symbol.cs (2)
808return this.Equals(obj as Symbol, SymbolEqualityComparer.Default.CompareKind); 813return this.Equals(other, SymbolEqualityComparer.Default.CompareKind);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
355type.Equals(symbol, SymbolEqualityComparer.Default) &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
266!SymbolEqualityComparer.Default.Equals(expressionConvertedType, expressionType))
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
148if (SymbolEqualityComparer.Default.Equals(localType, asType) &&
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenTupleTest.cs (1)
27502Assert.False(type.Equals(underlyingType, SymbolEqualityComparer.Default));
Microsoft.CodeAnalysis.CSharp.Features (4)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
307methodParameterType.Equals(overloadParameter.Type, SymbolEqualityComparer.Default))
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
241if (!isEnumOrCompletionListType && !SymbolEqualityComparer.Default.Equals(type, symbolType))
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
266!SymbolEqualityComparer.Default.Equals(expressionConvertedType, expressionType))
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
148if (SymbolEqualityComparer.Default.Equals(localType, asType) &&
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (14)
Semantics\NativeIntegerTests.cs (1)
268Assert.False(underlyingType.Equals(nativeIntegerType, SymbolEqualityComparer.Default));
Semantics\NullableReferenceTypesTests.cs (13)
115898Assert.True(c.Equals(c2, SymbolEqualityComparer.Default.CompareKind)); 157589Assert.True(field2.Equals(field3, SymbolEqualityComparer.Default)); 157591Assert.True(field3.Equals(field2, SymbolEqualityComparer.Default)); 157595Assert.True(field1.Equals(field2, SymbolEqualityComparer.Default)); 157597Assert.True(field2.Equals(field1, SymbolEqualityComparer.Default)); 157601Assert.True(field1.Equals(field3, SymbolEqualityComparer.Default)); 157603Assert.True(field3.Equals(field1, SymbolEqualityComparer.Default)); 157641Assert.False(method2.Equals(method3, SymbolEqualityComparer.Default)); 157643Assert.False(method3.Equals(method2, SymbolEqualityComparer.Default)); 157647Assert.False(method1.Equals(method2, SymbolEqualityComparer.Default)); 157649Assert.False(method2.Equals(method1, SymbolEqualityComparer.Default)); 157653Assert.True(method1.Equals(method3, SymbolEqualityComparer.Default)); 157655Assert.True(method3.Equals(method1, SymbolEqualityComparer.Default));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (15)
Symbols\Source\NullablePublicAPITests.cs (1)
2843Assert.True(event1.Equals(event2, SymbolEqualityComparer.Default));
Symbols\SymbolEqualityTests.cs (14)
380Assert.False(SymbolEqualityComparer.Default.Equals(symbol1, symbol2)); 381Assert.False(SymbolEqualityComparer.Default.Equals(symbol2, symbol1)); 382Assert.NotEqual(SymbolEqualityComparer.Default.GetHashCode(symbol1), SymbolEqualityComparer.Default.GetHashCode(symbol2)); 387Assert.True(SymbolEqualityComparer.Default.Equals(symbol2, symbol3)); 388Assert.True(SymbolEqualityComparer.Default.Equals(symbol3, symbol2)); 389Assert.Equal(SymbolEqualityComparer.Default.GetHashCode(symbol2), SymbolEqualityComparer.Default.GetHashCode(symbol3)); 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)); 993Assert.Equal(SymbolEqualityComparer.Default.GetHashCode(symbol1), SymbolEqualityComparer.Default.GetHashCode(symbol2));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
Extensions.cs (3)
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)));
FunctionPointerUtilities.cs (2)
255Assert.Equal<ISymbol>(signatureType, semanticInfo.Type, SymbolEqualityComparer.Default); 259Assert.Equal(signatureType, semanticInfo.Type, SymbolEqualityComparer.Default);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
355type.Equals(symbol, SymbolEqualityComparer.Default) &&
Microsoft.CodeAnalysis.Features (26)
Completion\Providers\AbstractContextVariableArgumentProvider.cs (1)
117if (requireExactType && !SymbolEqualityComparer.Default.Equals(context.Parameter.Type, symbolType))
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (2)
63var inferredTypes = context.InferredTypes.Where(t => t.SpecialType != SpecialType.System_Void).ToSet(SymbolEqualityComparer.Default); 210var typeConvertibilityCache = new Dictionary<ITypeSymbol, bool>(SymbolEqualityComparer.Default);
Completion\Providers\AbstractSymbolCompletionProvider.cs (2)
46/// <param name="typeConvertibilityCache">A cache to use for repeated lookups. This should be created with <see cref="SymbolEqualityComparer.Default"/> 126var typeConvertibilityCache = new Dictionary<ITypeSymbol, bool>(SymbolEqualityComparer.Default);
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (2)
54if (allAnonymousNodes.Any(t => !anonymousType.Equals(t.symbol, SymbolEqualityComparer.Default))) 117if (allAnonymousTypes || anonymousType.Equals(symbol, SymbolEqualityComparer.Default))
EditAndContinue\Utilities\Extensions.cs (2)
176=> symbol is IMethodSymbol { Parameters: [var parameter] } && SymbolEqualityComparer.Default.Equals(parameter.Type, symbol.ContainingType); 182static (param, constructor) => param.RefKind == RefKind.Out && param.Type.Equals(constructor.Parameters[param.Ordinal].Type, SymbolEqualityComparer.Default),
ExtractMethod\MethodExtractor.cs (1)
240if (currentType == null || !SymbolEqualityComparer.Default.Equals(currentType, semanticModel.ResolveType(typeParameter)))
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (1)
110where constructorTypes.SequenceEqual(symbolTypes, SymbolEqualityComparer.Default)
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (1)
130static (c, parameterTypes) => c.Parameters.Select(p => p.Type).SequenceEqual(parameterTypes, SymbolEqualityComparer.Default), parameterTypes))
Shared\Utilities\ExtractTypeHelpers.cs (1)
231if (type.Equals(typeParameter, SymbolEqualityComparer.Default) ||
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (1)
126hasUnderlyingTypeArm |= SymbolEqualityComparer.Default.Equals(
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (1)
201hasUnderlyingTypeCase |= SymbolEqualityComparer.Default.Equals(
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
493if (SymbolEqualityComparer.Default.Equals(entryPoint, member)) 856if (_iNotifyCompletionType != null && Roslyn.Utilities.ImmutableArrayExtensions.Contains(methodSymbol.ContainingType.AllInterfaces, _iNotifyCompletionType, SymbolEqualityComparer.Default)
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
172=> SymbolEqualityComparer.Default.Equals(type, FindType<T>(semanticModel));
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (4)
158if (!targetTypeSymbol.Equals(enumerableType, SymbolEqualityComparer.Default)) 178=> whereMethodSymbol.Equals(invocation.TargetMethod.ReducedFrom ?? invocation.TargetMethod.OriginalDefinition, SymbolEqualityComparer.Default); 181=> selectMethodSymbol.Equals(invocation.TargetMethod.ReducedFrom ?? invocation.TargetMethod.OriginalDefinition, SymbolEqualityComparer.Default); 184=> linqMethods.Any(static (m, invocation) => m.Equals(invocation.TargetMethod.ReducedFrom ?? invocation.TargetMethod.OriginalDefinition, SymbolEqualityComparer.Default), invocation);
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
83if (SymbolEqualityComparer.Default.Equals(firstType, secondType))
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (1)
48var result = capturedTypeParameters.Except<ITypeParameterSymbol>(availableTypeParameters, SymbolEqualityComparer.Default).ToImmutableArray();
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
183var result = new Dictionary<ITypeSymbol, ITypeParameterSymbol>(SymbolEqualityComparer.Default);
ValueTracking\ValueTracker.cs (1)
108var isParameterForPreviousTrackedMethod = previousSymbol?.Equals(parameterSymbol.ContainingSymbol, SymbolEqualityComparer.Default) == true;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
839Return Me.[Equals](TryCast(other, Symbol), SymbolEqualityComparer.Default.CompareKind)
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 (13)
FindSymbols\SymbolFinder_Helpers.cs (1)
81if (searchSymbol.Equals(symbolToMatch, SymbolEqualityComparer.Default))
Recommendations\AbstractRecommendationServiceRunner.cs (5)
126if (!parameterTypeSymbols.Contains(parameter.Type, SymbolEqualityComparer.Default)) 445if (SymbolEqualityComparer.Default.Equals(originalContainerType, originalConstraintType)) 464if (SymbolEqualityComparer.Default.Equals(constraintTypeInterface.OriginalDefinition, originalConstraintType)) 475if (SymbolEqualityComparer.Default.Equals(interfaceType.OriginalDefinition, originalConstraintType)) 514if (SymbolEqualityComparer.Default.Equals(current.OriginalDefinition, matched))
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)
236return method.Parameters.Any(static (p, within) => p.Type.Equals(within, SymbolEqualityComparer.Default), within);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (2)
56var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>(SymbolEqualityComparer.Default); 110var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>(SymbolEqualityComparer.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
394return memberType.AllInterfaces.Contains(constructed, equalityComparer: SymbolEqualityComparer.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
134SymbolEqualityComparer.Default.Equals(returnType, valueTaskType)) is IMethodSymbol disposeMethodFromPattern)
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\ResourceUsageAnalyzer.cs (1)
47SymbolEqualityComparer.Default.Equals(memberSymbol.ContainingType, SRSymbol) &&
Microsoft.Extensions.Logging.Generators (2)
LoggerMessageGenerator.Parser.cs (2)
113if (attrCtorSymbol == null || !loggerMessageAttribute.Equals(attrCtorSymbol.ContainingType, SymbolEqualityComparer.Default)) 129if (!SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, loggerMessageAttribute))
Microsoft.Extensions.Options.SourceGeneration (21)
Parser.cs (19)
29private readonly Dictionary<ITypeSymbol, ValidatorType> _synthesizedValidators = new(SymbolEqualityComparer.Default); 30private readonly HashSet<ITypeSymbol> _visitedModelTypes = new(SymbolEqualityComparer.Default); 205&& SymbolEqualityComparer.Default.Equals(m.Parameters[1].Type, modelType)); 249if (SymbolEqualityComparer.Default.Equals(type.OriginalDefinition, _symbolHolder.GenericIEnumerableSymbol)) 257if (SymbolEqualityComparer.Default.Equals(implementingInterface.OriginalDefinition, _compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T))) 355if (SymbolEqualityComparer.Default.Equals(attributeType, _symbolHolder.ValidateObjectMembersAttributeSymbol)) 408else if (SymbolEqualityComparer.Default.Equals(attributeType, _symbolHolder.ValidateEnumeratedItemsAttributeSymbol)) 480if (SymbolEqualityComparer.Default.Equals(attributeType, _symbolHolder.MaxLengthAttributeSymbol) || 481SymbolEqualityComparer.Default.Equals(attributeType, _symbolHolder.MinLengthAttributeSymbol) || 482(_symbolHolder.LengthAttributeSymbol is not null && SymbolEqualityComparer.Default.Equals(attributeType, _symbolHolder.LengthAttributeSymbol))) 489else if (SymbolEqualityComparer.Default.Equals(attributeType, _symbolHolder.CompareAttributeSymbol)) 493else if (SymbolEqualityComparer.Default.Equals(attributeType, _symbolHolder.RangeAttributeSymbol)) 668else if (SymbolEqualityComparer.Default.Equals(namedTypeSymbol, _symbolHolder.TimeSpanSymbol) && 669(SymbolEqualityComparer.Default.Equals(typeSymbol, _symbolHolder.TimeSpanSymbol) || typeSymbol.SpecialType == SpecialType.System_String)) 738if (SymbolEqualityComparer.Default.Equals(implementingInterface.OriginalDefinition, _symbolHolder.IValidatableObjectSymbol)) 752if (SymbolEqualityComparer.Default.Equals(implementingInterface.OriginalDefinition, _symbolHolder.ValidateOptionsSymbol)) 765if (SymbolEqualityComparer.Default.Equals(implementingInterface.OriginalDefinition, _symbolHolder.ValidateOptionsSymbol)) 768if (SymbolEqualityComparer.Default.Equals(modelType, t)) 816if (SymbolEqualityComparer.Default.Equals(type, _symbolHolder.TypeSymbol) &&
ParserUtilities.cs (2)
24if (SymbolEqualityComparer.Default.Equals(attribute, item.AttributeClass) && item.AttributeConstructor != null) 62if (SymbolEqualityComparer.Default.Equals(interfaceType, iface))
Microsoft.Gen.ComplianceReports (1)
Parser.cs (1)
209if (SymbolEqualityComparer.Default.Equals(_symbolHolder.LoggerMessageAttribute, a.AttributeClass))
Microsoft.Gen.ContextualOptions (6)
ContextReceiver.cs (3)
49.Where(_ => _.symbol!.GetAttributes().Any(attribute => SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, holder!.OptionsContextAttribute))) 50.ToLookup(_ => _.symbol, _ => _.declaration, comparer: SymbolEqualityComparer.Default) 52group => (INamedTypeSymbol)group.Key!, group => group.ToList(), comparer: SymbolEqualityComparer.Default);
ContextualOptionsGenerator.cs (3)
41.Where(_ => _.symbol!.GetAttributes().Any(attribute => SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, holder!.OptionsContextAttribute))) 42.ToLookup(_ => _.symbol, _ => _.declaration, comparer: SymbolEqualityComparer.Default) 44group => (INamedTypeSymbol)group.Key!, group => group.ToList(), comparer: SymbolEqualityComparer.Default);
Microsoft.Gen.Logging (17)
Parsing\AttributeProcessors.cs (1)
43if (SymbolEqualityComparer.Default.Equals(a.Type, symbols.LogLevelSymbol))
Parsing\Parser.cs (4)
475.Where(x => !SymbolEqualityComparer.Default.Equals(x, symbols.NoDataClassificationAttribute)) 561.Distinct(SymbolEqualityComparer.Default) 588IsLogLevel = !parsingState.FoundLogLevel && SymbolEqualityComparer.Default.Equals(paramTypeSymbol, symbols.LogLevelSymbol), 610if (attrCtor != null && SymbolEqualityComparer.Default.Equals(attrCtor.ContainingType, symbols.LoggerMessageAttribute))
Parsing\Parser.LogProperties.cs (1)
51var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
Parsing\Parser.Records.cs (1)
22var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
Parsing\Parser.TagProvider.cs (3)
101&& SymbolEqualityComparer.Default.Equals(tagCollectorType, method.Parameters[0].Type) 163if (SymbolEqualityComparer.Default.Equals(type.WithNullableAnnotation(NullableAnnotation.None), target.WithNullableAnnotation(NullableAnnotation.None))) 170if (SymbolEqualityComparer.Default.Equals(target.WithNullableAnnotation(NullableAnnotation.None), iface.WithNullableAnnotation(NullableAnnotation.None)))
Parsing\SymbolLoader.cs (1)
93var ignorePropsSymbols = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default);
Parsing\TypeSymbolExtensions.cs (4)
13=> (sym.ImplementsInterface(symbols.EnumerableSymbol) || SymbolEqualityComparer.Default.Equals(sym, symbols.EnumerableSymbol)) 28&& SymbolEqualityComparer.Default.Equals(ts.Parameters[0].Type, symbols.FormatProviderSymbol)) 52&& SymbolEqualityComparer.Default.Equals(ts.Parameters[1].Type, symbols.FormatProviderSymbol)) 67return symbols.SpanFormattableSymbol != null && (sym.ImplementsInterface(symbols.SpanFormattableSymbol) || SymbolEqualityComparer.Default.Equals(sym, symbols.SpanFormattableSymbol));
src\Generators\Shared\ParserUtilities.cs (2)
29if (SymbolEqualityComparer.Default.Equals(attribute, item.AttributeClass) && item.AttributeConstructor != null) 67if (SymbolEqualityComparer.Default.Equals(interfaceType, iface))
Microsoft.Gen.Logging.Unit.Tests (1)
LogParserUtilitiesTests.cs (1)
142new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default),
Microsoft.Gen.Metrics (9)
Parser.cs (7)
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)) 632var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 909var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
src\Generators\Shared\ParserUtilities.cs (2)
29if (SymbolEqualityComparer.Default.Equals(attribute, item.AttributeClass) && item.AttributeConstructor != null) 67if (SymbolEqualityComparer.Default.Equals(interfaceType, iface))
Microsoft.Gen.MetricsReports (9)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (7)
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)) 632var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 909var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
src\Generators\Shared\ParserUtilities.cs (2)
29if (SymbolEqualityComparer.Default.Equals(attribute, item.AttributeClass) && item.AttributeConstructor != null) 67if (SymbolEqualityComparer.Default.Equals(interfaceType, iface))
Microsoft.Interop.ComInterfaceGenerator (21)
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 (5)
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)); 53var methodsOfInterest = new Dictionary<ISymbol, ImmutableArray<Func<IInvocationOperation, (ITypeSymbol, Location)?>>>(SymbolEqualityComparer.Default); 186else if (operand is IInvocationOperation invocation && invocation.TargetMethod.Equals(getObjectForIUnknown, SymbolEqualityComparer.Default))
ComInterfaceGenerator.cs (3)
248if (lcidConversionAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, lcidConversionAttrType)) 252else if (suppressGCTransitionAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, suppressGCTransitionAttrType)) 256else if (unmanagedCallConvAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, unmanagedCallConvAttrType))
ComInterfaceInfo.cs (1)
147if (SymbolEqualityComparer.Default.Equals(baseSymbol.ContainingAssembly, symbol.ContainingAssembly))
VtableIndexStubGenerator.cs (4)
217else if (lcidConversionAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, lcidConversionAttrType)) 221else if (suppressGCTransitionAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, suppressGCTransitionAttrType)) 225else if (unmanagedCallConvAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, unmanagedCallConvAttrType)) 294bool implementsIUnmanagedInterfaceOfSelf = symbol.ContainingType.AllInterfaces.Any(iface => SymbolEqualityComparer.Default.Equals(iface, expectedUnmanagedInterfaceType));
Microsoft.Interop.JavaScript.JSImportGenerator (1)
JSMarshalAsAttributeInfoParser.cs (1)
21public bool CanParseAttributeType(INamedTypeSymbol attributeType) => attributeType.IsGenericType && SymbolEqualityComparer.Default.Equals(_jsMarshalAsAttribute, attributeType.ConstructUnboundGenericType());
Microsoft.Interop.LibraryImportGenerator (21)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
123if (SymbolEqualityComparer.Default.Equals(attr.AttributeClass, libraryImportAttrType))
Analyzers\ConvertToLibraryImportFixer.cs (1)
664if (SymbolEqualityComparer.Default.Equals(attrLocal.AttributeClass, attributeType))
Analyzers\CustomMarshallerAttributeAnalyzer.cs (12)
646&& attrCreation.Type.Equals(_customMarshallerAttribute, SymbolEqualityComparer.Default)) 894if (!SymbolEqualityComparer.Default.Equals(methods.UnmanagedValuesDestination.Parameters[0].Type, unmanagedType)) 903if (!SymbolEqualityComparer.Default.Equals(methods.ToUnmanaged.ReturnType, methods.ToUnmanagedWithBuffer.ReturnType)) 915if (unmanagedType is not null && !SymbolEqualityComparer.Default.Equals(unmanagedType, toManagedMethod.Parameters[0].Type)) 925if (!SymbolEqualityComparer.Default.Equals(methods.UnmanagedValuesSource.Parameters[0].Type, unmanagedType)) 934if (!SymbolEqualityComparer.Default.Equals(methods.ToManaged.Parameters[1].Type, methods.ToManagedFinally.Parameters[1].Type)) 949&& !SymbolEqualityComparer.Default.Equals(sourceElementType, destinationElementType)) 967&& !SymbolEqualityComparer.Default.Equals(sourceElementType, expectedElementType)) 998if (SymbolEqualityComparer.Default.Equals(spanTypeMaybe.OriginalDefinition, _spanOfT) || SymbolEqualityComparer.Default.Equals(spanTypeMaybe.OriginalDefinition, _readOnlySpanOfT)) 1213if (unmanagedType is not null && !SymbolEqualityComparer.Default.Equals(unmanagedType, fromUnmanagedMethod.Parameters[0].Type)) 1237&& !SymbolEqualityComparer.Default.Equals(sourceElementType, destinationElementType))
Analyzers\CustomMarshallerAttributeFixer.cs (1)
55Dictionary<INamedTypeSymbol, INamedTypeSymbol> partiallyUpdatedSymbols = new(SymbolEqualityComparer.Default);
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
66&& SymbolEqualityComparer.Default.Equals(constructedMarshallerType, marshallerType));
LibraryImportGenerator.cs (5)
245else if (lcidConversionAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, lcidConversionAttrType)) 249else if (suppressGCTransitionAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, suppressGCTransitionAttrType)) 253else if (unmanagedCallConvAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, unmanagedCallConvAttrType)) 257else if (defaultDllImportSearchPathsAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, defaultDllImportSearchPathsAttrType)) 261else if (wasmImportLinkageAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, wasmImportLinkageAttrType))
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
DownlevelLibraryImportGenerator.cs (2)
180else if (lcidConversionAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, lcidConversionAttrType)) 184else if (defaultDllImportSearchPathsAttrType is not null && SymbolEqualityComparer.Default.Equals(attr.AttributeClass, defaultDllImportSearchPathsAttrType))
Microsoft.Interop.SourceGeneration (45)
IncrementalGeneratorInitializationContextExtensions.cs (1)
37(context, ct) => SymbolEqualityComparer.Default.Equals(context.Attributes[0].AttributeClass.ContainingAssembly, context.SemanticModel.Compilation.GetSpecialType(SpecialType.System_Object).ContainingAssembly))
ManualTypeMarshallingHelper.cs (1)
199if (!SymbolEqualityComparer.Default.Equals(managedType, managedTypeInst))
MarshallerShape.cs (35)
221&& SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, managedType)); 228if (!SymbolEqualityComparer.Default.Equals(spanOfT, namedType.ConstructedFrom) || namedType.TypeArguments.Length != 1) 242&& SymbolEqualityComparer.Default.Equals(currentType.TypeArguments[i], typeArgument)) 263&& SymbolEqualityComparer.Default.Equals(managedType, m.Parameters[0].Type)); 275&& SymbolEqualityComparer.Default.Equals(managedType, m.Parameters[0].Type)); 294&& SymbolEqualityComparer.Default.Equals(managedType, m.ReturnType)); 303&& SymbolEqualityComparer.Default.Equals(managedType, m.ReturnType)); 348&& SymbolEqualityComparer.Default.Equals(readOnlySpanOfT, returnType.ConstructedFrom)); 358&& SymbolEqualityComparer.Default.Equals(spanOfT, returnType.ConstructedFrom)); 388&& SymbolEqualityComparer.Default.Equals(spanOfT, returnType.ConstructedFrom)); 398&& SymbolEqualityComparer.Default.Equals(readOnlySpanOfT, returnType.ConstructedFrom)); 429return SymbolEqualityComparer.Default.Equals(method, FromManaged) 430|| SymbolEqualityComparer.Default.Equals(method, FromManagedWithBuffer) 431|| SymbolEqualityComparer.Default.Equals(method, ToManaged) 432|| SymbolEqualityComparer.Default.Equals(method, ToManagedGuaranteed) 433|| SymbolEqualityComparer.Default.Equals(method, FromUnmanaged) 434|| SymbolEqualityComparer.Default.Equals(method, ToUnmanaged) 435|| SymbolEqualityComparer.Default.Equals(method, Free) 436|| SymbolEqualityComparer.Default.Equals(method, OnInvoked) 437|| SymbolEqualityComparer.Default.Equals(method, StatelessGetPinnableReference) 438|| SymbolEqualityComparer.Default.Equals(method, StatefulGetPinnableReference) 439|| SymbolEqualityComparer.Default.Equals(method, ManagedValuesSource) 440|| SymbolEqualityComparer.Default.Equals(method, UnmanagedValuesDestination) 441|| SymbolEqualityComparer.Default.Equals(method, ManagedValuesDestination) 442|| SymbolEqualityComparer.Default.Equals(method, UnmanagedValuesSource); 566&& SymbolEqualityComparer.Default.Equals(managedType, m.Parameters[0].Type)); 577&& SymbolEqualityComparer.Default.Equals(managedType, m.Parameters[0].Type)); 595&& SymbolEqualityComparer.Default.Equals(managedType, m.ReturnType)); 603&& SymbolEqualityComparer.Default.Equals(managedType, m.ReturnType)); 641if (SymbolEqualityComparer.Default.Equals(candidates[0].Parameters[0].Type, unmanagedType)) 672&& SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, managedType)); 691&& SymbolEqualityComparer.Default.Equals(readOnlySpanOfT, returnType.ConstructedFrom)); 700&& SymbolEqualityComparer.Default.Equals(spanOfT, returnType.ConstructedFrom)); 710&& SymbolEqualityComparer.Default.Equals(spanOfT, returnType.ConstructedFrom)); 720&& SymbolEqualityComparer.Default.Equals(readOnlySpanOfT, returnType.ConstructedFrom));
SafeHandleMarshallingInfoProvider.cs (1)
32if (currentType.Equals(_safeHandleType, SymbolEqualityComparer.Default))
TypePositionInfo.cs (2)
127if (SymbolEqualityComparer.Default.Equals(attr.AttributeClass, outAttributeType)) 132else if (SymbolEqualityComparer.Default.Equals(attr.AttributeClass, inAttributeType))
TypeSymbolExtensions.cs (5)
34return IsBlittableWorker(type, ImmutableHashSet.Create<ITypeSymbol>(SymbolEqualityComparer.Default), compilation: null!, &IsConsideredBlittableWorker); 59return IsBlittableWorker(type, ImmutableHashSet.Create<ITypeSymbol>(SymbolEqualityComparer.Default), compilation, &IsStrictlyBlittableWorker); 83if (t.ContainingAssembly.Equals(compilation.GetSpecialType(SpecialType.System_Object).ContainingAssembly, SymbolEqualityComparer.Default)) 210(INamedTypeSymbol namedType, INamedTypeSymbol namedOther) => SymbolEqualityComparer.Default.Equals(namedType.ConstructedFrom, namedOther.ConstructedFrom), 211_ => SymbolEqualityComparer.Default.Equals(type, other)
Microsoft.Maui.Controls.SourceGen (3)
CodeBehindGenerator.cs (3)
214 if (SymbolEqualityComparer.Default.Equals(attr.AttributeClass, xmlnsDefinitonAttribute)) 229 else if (SymbolEqualityComparer.Default.Equals(attr.AttributeClass, internalsVisibleToAttribute)) 592 if (type.DeclaredAccessibility == Accessibility.Internal && internalsVisible.Contains(type.ContainingAssembly, SymbolEqualityComparer.Default))
System.Private.CoreLib.Generators (14)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (14)
139HashSet<INamedTypeSymbol> namedTypesToBeProtected = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default); 173if (attributeData.AttributeClass.Equals(bypassReadyToRunAttribute, SymbolEqualityComparer.Default)) 386if (attributeData.AttributeClass.Equals(compExactlyDependsOn, SymbolEqualityComparer.Default)) 399HashSet<INamedTypeSymbol> examinedSymbols = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default); 406if (symbolOfInvokeTarget.ContainingSymbol.Equals(symbol, SymbolEqualityComparer.Default)) 411if (helperForType.Equals(symbol, SymbolEqualityComparer.Default)) 427HashSet<INamedTypeSymbol> examinedSymbols = new HashSet<INamedTypeSymbol>(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)) 568HashSet<INamedTypeSymbol> notTypes = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default); 606HashSet<ISymbol> foundSymbols = new HashSet<ISymbol>(SymbolEqualityComparer.Default);
System.Text.Json.SourceGeneration (33)
Helpers\KnownTypeSymbols.cs (2)
273SymbolEqualityComparer cmp = SymbolEqualityComparer.Default; 326SymbolEqualityComparer cmp = SymbolEqualityComparer.Default;
Helpers\RoslynExtensions.cs (6)
120=> attributeType != null && memberInfo.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, attributeType)); 134if (type.AllInterfaces.Contains(baseType, SymbolEqualityComparer.Default)) 142if (SymbolEqualityComparer.Default.Equals(baseType, current)) 183return candidate.IsGenericType && SymbolEqualityComparer.Default.Equals(candidate.ConstructedFrom, baseType); 188=> type is INamedTypeSymbol { IsGenericType: true } namedType && SymbolEqualityComparer.Default.Equals(namedType, namedType.ConstructedFrom); 251return JsonHelpers.TraverseGraphWithTopologicalSort<INamedTypeSymbol>(namedType, static t => t.AllInterfaces, SymbolEqualityComparer.Default);
JsonSourceGenerator.Parser.cs (25)
47private readonly Dictionary<ITypeSymbol, TypeGenerationSpec> _generatedTypes = new(SymbolEqualityComparer.Default); 244if (SymbolEqualityComparer.Default.Equals(attributeClass, _knownSymbols.JsonSerializableAttributeType)) 254else if (SymbolEqualityComparer.Default.Equals(attributeClass, _knownSymbols.JsonSourceGenerationOptionsAttributeType)) 703if (SymbolEqualityComparer.Default.Equals(attributeType, _knownSymbols.JsonNumberHandlingAttributeType)) 708else if (SymbolEqualityComparer.Default.Equals(attributeType, _knownSymbols.JsonUnmappedMemberHandlingAttributeType)) 713else if (SymbolEqualityComparer.Default.Equals(attributeType, _knownSymbols.JsonObjectCreationHandlingAttributeType)) 724if (SymbolEqualityComparer.Default.Equals(attributeType, _knownSymbols.JsonDerivedTypeAttributeType)) 755if (SymbolEqualityComparer.Default.Equals(type.OriginalDefinition, _knownSymbols.MemoryType)) 757Debug.Assert(!SymbolEqualityComparer.Default.Equals(type, _knownSymbols.MemoryByteType)); 763if (SymbolEqualityComparer.Default.Equals(type.OriginalDefinition, _knownSymbols.ReadOnlyMemoryType)) 765Debug.Assert(!SymbolEqualityComparer.Default.Equals(type, _knownSymbols.ReadOnlyMemoryByteType)); 819needsRuntimeType = SymbolEqualityComparer.Default.Equals(type, actualTypeToConvert); 826needsRuntimeType = SymbolEqualityComparer.Default.Equals(type, actualTypeToConvert); 878needsRuntimeType = SymbolEqualityComparer.Default.Equals(type, actualTypeToConvert); 1022SymbolEqualityComparer.Default.Equals(property.Type, ignoredMember.GetMemberType()); 1096if (SymbolEqualityComparer.Default.Equals(type, _knownSymbols.JsonObjectType)) 1107return SymbolEqualityComparer.Default.Equals(actualDictionaryType.TypeArguments[0], _knownSymbols.StringType) && 1108(SymbolEqualityComparer.Default.Equals(actualDictionaryType.TypeArguments[1], _knownSymbols.ObjectType) || 1109SymbolEqualityComparer.Default.Equals(actualDictionaryType.TypeArguments[1], _knownSymbols.JsonElementType)); 1566if (!SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, _knownSymbols.JsonConverterAttributeType)) 1668SymbolEqualityComparer cmp = SymbolEqualityComparer.Default; 1787SymbolEqualityComparer.Default.Equals(_knownSymbols.SerializationInfoType, type) || 1788SymbolEqualityComparer.Default.Equals(_knownSymbols.IntPtrType, type) || 1789SymbolEqualityComparer.Default.Equals(_knownSymbols.UIntPtrType, type) || 1811HashSet<ITypeSymbol> builtInSupportTypes = new(SymbolEqualityComparer.Default);
System.Text.RegularExpressions.Generator (5)
RegexGenerator.Parser.cs (2)
119!SymbolEqualityComparer.Default.Equals(regexMethodSymbol.ReturnType, regexSymbol)) 133!SymbolEqualityComparer.Default.Equals(regexPropertySymbol.Type, regexSymbol))
UpgradeToGeneratedRegexAnalyzer.cs (3)
68HashSet<IMethodSymbol> hash = new HashSet<IMethodSymbol>(SymbolEqualityComparer.Default); 95if (!method.IsStatic || !SymbolEqualityComparer.Default.Equals(method.ContainingType, regexTypeSymbol)) 126if (!SymbolEqualityComparer.Default.Equals(operation.Type, regexTypeSymbol))
System.Windows.Forms.PrivateSourceGenerators (2)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (2)
207HashSet<ITypeSymbol> foundTypes = new(SymbolEqualityComparer.Default); 226bool isFlags = enumType.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, flagsAttributeType));