8 implementations of MethodKind
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
72public virtual MethodKind MethodKind => MethodKind.Ordinary;
Microsoft.CodeAnalysis.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
72public virtual MethodKind MethodKind => MethodKind.Ordinary;
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
72public virtual MethodKind MethodKind => MethodKind.Ordinary;
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\MethodSymbol.cs (1)
34MethodKind IMethodSymbol.MethodKind
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
50public MethodKind MethodKind => _symbol.MethodKind;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
957Private ReadOnly Property IMethodSymbol_MethodKind As MethodKind Implements IMethodSymbol.MethodKind
Microsoft.CodeAnalysis.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
72public virtual MethodKind MethodKind => MethodKind.Ordinary;
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
72public virtual MethodKind MethodKind => MethodKind.Ordinary;
732 references to MethodKind
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
339if (invocation.TargetMethod.MethodKind != MethodKind.DelegateInvoke ||
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (1)
111IMethodReferenceOperation m when m.Method.MethodKind == MethodKind.Constructor => m.Method.ContainingType,
GenerateDocumentationAndConfigFiles (59)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (8)
165return method is { Name: "Dispose", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters.IsEmpty: true }; 185Name: "Dispose", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters: [{ Type.SpecialType: SpecialType.System_Boolean, RefKind: RefKind.None }] 194return method is { Name: "Close", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters.IsEmpty: true }; 213method.MethodKind == MethodKind.Ordinary && 226method.MethodKind == MethodKind.Ordinary && 239method.MethodKind == MethodKind.Ordinary && 467return method.MethodKind switch 476return method.MethodKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
323switch (operation.TargetMethod.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
46return method.MethodKind is MethodKind.Ordinary or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
167switch (((IMethodSymbol)currentSymbol).MethodKind) 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
323IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
143if (symbol.MethodKind == MethodKind.Conversion)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
371switch (methodSymbol.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
408if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 478if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol && 479newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol) 875=> symbol is IMethodSymbol { MethodKind: MethodKind.DelegateInvoke };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (1)
79if (symbol.MethodKind == MethodKind.BuiltinOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (5)
242if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 440if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 441method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 651IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true, 652IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (2)
33MethodKind: MethodKind.Constructor, 65MethodKind: MethodKind.Constructor,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (13)
201MethodKind: MethodKind.Ordinary or 241=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 268=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 278=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 287=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 290=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 293=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 296=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 299=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 302=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 305=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 646=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (5)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction) 91if (method1.MethodKind != method2.MethodKind ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
202if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 207if (x.MethodKind == MethodKind.FunctionPointerSignature)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
172if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
375methodKind: accessor.MethodKind, 536methodKind: method.MethodKind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (2)
168return [.. this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)]; 177return [.. this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic)];
ILLink.RoslynAnalyzer (16)
DataFlow\LocalDataFlowAnalysis.cs (1)
90methodSymbol.MethodKind is not (MethodKind.LambdaMethod or MethodKind.LocalFunction));
DataFlow\LocalDataFlowVisitor.cs (3)
683Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction); 836Debug.Assert(lambda.MethodKind == MethodKind.LambdaMethod); 975Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction);
DynamicallyAccessedMembersAnalyzer.cs (4)
326if ((methodSymbol.MethodKind != MethodKind.PropertyGet && methodSymbol.MethodKind != MethodKind.PropertySet) 338if (methodSymbol.MethodKind == MethodKind.PropertyGet 341|| methodSymbol.MethodKind == MethodKind.PropertySet
ISymbolExtensions.cs (2)
213=> (symbol as IMethodSymbol)?.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor; 216=> (symbol as IMethodSymbol)?.MethodKind == MethodKind.StaticConstructor;
TrimAnalysis\FlowAnnotations.cs (2)
181if (parameterMethod!.MethodKind == MethodKind.PropertySet 205if (method.MethodKind is MethodKind.PropertyGet
TrimAnalysis\HandleCallAction.cs (2)
350if (method.Method.MethodKind == MethodKind.PropertyGet || method.Method.MethodKind == MethodKind.PropertySet)
TrimAnalysis\MethodReturnValue.cs (1)
23Debug.Assert(!isNewObj || methodSymbol.MethodKind == MethodKind.Constructor, "isNewObj can only be true for constructors");
TrimAnalysis\TrimAnalysisVisitor.cs (1)
435if (method.MethodKind != MethodKind.PropertyGet)
Microsoft.Analyzers.Local (1)
ApiLifecycle\AssemblyAnalysis.cs (1)
208return method.MethodKind
Microsoft.AspNetCore.App.Analyzers (1)
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
62if (method.MethodKind != MethodKind.Ordinary)
Microsoft.AspNetCore.Components.Analyzers (2)
InternalUsageAnalyzer.cs (2)
100if (method.MethodKind != MethodKind.PropertyGet) 107if (method.MethodKind != MethodKind.PropertySet)
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
InternalUsageAnalyzer.cs (2)
100if (method.MethodKind != MethodKind.PropertyGet) 107if (method.MethodKind != MethodKind.PropertySet)
Microsoft.AspNetCore.Mvc.Analyzers (3)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
69return method.MethodKind == MethodKind.Ordinary &&
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
62if (method.MethodKind != MethodKind.Ordinary)
TopLevelParameterNameAnalyzer.cs (1)
41if (method.MethodKind != MethodKind.Ordinary)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
62if (method.MethodKind != MethodKind.Ordinary)
Microsoft.AspNetCore.OpenApi.SourceGenerators (2)
XmlCommentGenerator.Parser.cs (1)
100if (method.MethodKind == MethodKind.Constructor)
XmlComments\XmlComment.InheritDoc.cs (1)
282if (methodSymbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor)
Microsoft.CodeAnalysis (14)
CodeGen\CompilationTestData.cs (1)
128var format = (iMethod.MethodKind == MethodKind.UserDefinedOperator) ?
Compilation\Compilation.cs (2)
1559/// Creates an <see cref="IMethodSymbol"/> whose <see cref="IMethodSymbol.MethodKind"/> is <see 1587/// Creates an <see cref="IMethodSymbol"/> whose <see cref="IMethodSymbol.MethodKind"/> is <see
Operations\CommonConversion.cs (3)
76public bool IsUserDefined => MethodSymbol is { MethodKind: MethodKind.Conversion }; 87{ MethodKind: MethodKind.Constructor, ContainingType.IsUnion: true } or 89MethodKind: MethodKind.Ordinary, IsStatic: true, Name: WellKnownMemberNames.UnionFactoryMethodName,
Operations\ControlFlowGraph.cs (1)
57Debug.Assert(method.MethodKind == MethodKind.LocalFunction);
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (2)
98Debug.Assert(symbol.MethodKind == MethodKind.LocalFunction); 117Debug.Assert(others.All(((IMethodSymbol m, ILocalFunctionOperation _) tuple) => tuple.m.MethodKind == MethodKind.LocalFunction));
Symbols\IMethodSymbol.cs (3)
235/// Modifier types that are considered part of the calling convention of this method, if the <see cref="MethodKind"/> is <see cref="MethodKind.FunctionPointerSignature"/> 245/// If this method has <see cref="MethodKind"/> of <see cref="MethodKind.PropertyGet"/> or <see cref="MethodKind.PropertySet"/>, 247/// If this method has <see cref="MethodKind"/> of <see cref="MethodKind.EventAdd"/> or <see cref="MethodKind.EventRemove"/>,
Symbols\ISymbolExtensions.cs (2)
19if (method.MethodKind != MethodKind.ReducedExtension) 184MethodKind: MethodKind.Ordinary,
Microsoft.CodeAnalysis.Analyzers (59)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (8)
165return method is { Name: "Dispose", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters.IsEmpty: true }; 185Name: "Dispose", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters: [{ Type.SpecialType: SpecialType.System_Boolean, RefKind: RefKind.None }] 194return method is { Name: "Close", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters.IsEmpty: true }; 213method.MethodKind == MethodKind.Ordinary && 226method.MethodKind == MethodKind.Ordinary && 239method.MethodKind == MethodKind.Ordinary && 467return method.MethodKind switch 476return method.MethodKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
323switch (operation.TargetMethod.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
46return method.MethodKind is MethodKind.Ordinary or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
167switch (((IMethodSymbol)currentSymbol).MethodKind) 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
323IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
143if (symbol.MethodKind == MethodKind.Conversion)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
371switch (methodSymbol.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
408if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 478if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol && 479newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol) 875=> symbol is IMethodSymbol { MethodKind: MethodKind.DelegateInvoke };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (1)
79if (symbol.MethodKind == MethodKind.BuiltinOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (5)
242if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 440if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 441method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 651IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true, 652IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (2)
33MethodKind: MethodKind.Constructor, 65MethodKind: MethodKind.Constructor,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (13)
201MethodKind: MethodKind.Ordinary or 241=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 268=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 278=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 287=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 290=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 293=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 296=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 299=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 302=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 305=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 646=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (5)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction) 91if (method1.MethodKind != method2.MethodKind ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
202if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 207if (x.MethodKind == MethodKind.FunctionPointerSignature)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
172if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
375methodKind: accessor.MethodKind, 536methodKind: method.MethodKind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (2)
168return [.. this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)]; 177return [.. this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic)];
Microsoft.CodeAnalysis.AnalyzerUtilities (69)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (8)
165return method is { Name: "Dispose", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters.IsEmpty: true }; 185Name: "Dispose", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters: [{ Type.SpecialType: SpecialType.System_Boolean, RefKind: RefKind.None }] 194return method is { Name: "Close", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters.IsEmpty: true }; 213method.MethodKind == MethodKind.Ordinary && 226method.MethodKind == MethodKind.Ordinary && 239method.MethodKind == MethodKind.Ordinary && 467return method.MethodKind switch 476return method.MethodKind switch
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisHelper.cs (1)
155containingMethod.MethodKind == MethodKind.Constructor &&
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (1)
358Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or MethodKind.LocalFunction);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (2)
638if (method.MethodKind == MethodKind.Constructor 695if (method.MethodKind == MethodKind.Constructor
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\WebInputSources.cs (1)
117|| methodSymbol.MethodKind != MethodKind.Ordinary
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResult.cs (1)
159Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (8)
634Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction); 2482else if (invokedMethod.MethodKind == MethodKind.Constructor) 2553method.MethodKind == MethodKind.DelegateInvoke) 3293if (targetMethod.MethodKind == MethodKind.LocalFunction) 3337if (targetMethod.MethodKind == MethodKind.LocalFunction) 3347Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or 3473computeValueForInvocation: () => method.MethodKind == MethodKind.LocalFunction ? 3624if (methodReference.Method.MethodKind == MethodKind.LocalFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
323switch (operation.TargetMethod.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
46return method.MethodKind is MethodKind.Ordinary or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
167switch (((IMethodSymbol)currentSymbol).MethodKind) 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
323IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
143if (symbol.MethodKind == MethodKind.Conversion)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
371switch (methodSymbol.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
408if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 478if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol && 479newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol) 875=> symbol is IMethodSymbol { MethodKind: MethodKind.DelegateInvoke };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (1)
79if (symbol.MethodKind == MethodKind.BuiltinOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (5)
242if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 440if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 441method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 651IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true, 652IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (2)
33MethodKind: MethodKind.Constructor, 65MethodKind: MethodKind.Constructor,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (13)
201MethodKind: MethodKind.Ordinary or 241=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 268=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 278=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 287=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 290=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 293=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 296=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 299=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 302=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 305=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 646=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (5)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction) 91if (method1.MethodKind != method2.MethodKind ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
202if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 207if (x.MethodKind == MethodKind.FunctionPointerSignature)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
172if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
Microsoft.CodeAnalysis.CodeStyle (52)
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (1)
17methodSymbol.MethodKind == MethodKind.Constructor &&
src\roslyn\src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
146return symbol == null || symbol.IsStatic || symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction };
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
949switch (methodSymbol.MethodKind)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
323switch (operation.TargetMethod.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
46return method.MethodKind is MethodKind.Ordinary or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
167switch (((IMethodSymbol)currentSymbol).MethodKind) 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
323IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
143if (symbol.MethodKind == MethodKind.Conversion)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
371switch (methodSymbol.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
408if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 478if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol && 479newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol) 875=> symbol is IMethodSymbol { MethodKind: MethodKind.DelegateInvoke };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (1)
79if (symbol.MethodKind == MethodKind.BuiltinOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (5)
242if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 440if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 441method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 651IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true, 652IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (2)
33MethodKind: MethodKind.Constructor, 65MethodKind: MethodKind.Constructor,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (13)
201MethodKind: MethodKind.Ordinary or 241=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 268=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 278=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 287=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 290=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 293=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 296=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 299=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 302=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 305=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 646=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (5)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction) 91if (method1.MethodKind != method2.MethodKind ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
202if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 207if (x.MethodKind == MethodKind.FunctionPointerSignature)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
172if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
Microsoft.CodeAnalysis.CodeStyle.Fixes (10)
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
139var isConstructorInitializer = candidates.All(m => m.MethodKind == MethodKind.Constructor);
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (3)
141if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count) 167if (method.MethodKind != MethodKind.Constructor) 193if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, DeclaringSyntaxReferences: [var reference] } constructor)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
365return method1.MethodKind == MethodKind.Ordinary && 366method2.MethodKind == MethodKind.Ordinary &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
375methodKind: accessor.MethodKind, 536methodKind: method.MethodKind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (2)
168return [.. this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)]; 177return [.. this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic)];
Microsoft.CodeAnalysis.CSharp (14)
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
106Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
SymbolDisplay\SymbolDisplayVisitor.cs (1)
388return ((IMethodSymbol)symbol).MethodKind == MethodKind.LocalFunction;
SymbolDisplay\SymbolDisplayVisitor.Members.cs (12)
280if (symbol.MethodKind == MethodKind.AnonymousFunction) 287else if (symbol.MethodKind == MethodKind.FunctionPointerSignature) 295if (symbol.MethodKind == MethodKind.ReducedExtension && Format.ExtensionMethodStyle == SymbolDisplayExtensionMethodStyle.StaticMethod) 299else if (symbol.MethodKind != MethodKind.ReducedExtension && Format.ExtensionMethodStyle == SymbolDisplayExtensionMethodStyle.InstanceMethod) 323switch (symbol.MethodKind) 386if (symbol.MethodKind == MethodKind.LocalFunction) 391else if (symbol.MethodKind == MethodKind.ReducedExtension) 421switch (symbol.MethodKind) 449AddKeyword(symbol.MethodKind == MethodKind.PropertyGet ? SyntaxKind.GetKeyword : 464AddKeyword(symbol.MethodKind == MethodKind.EventAdd ? SyntaxKind.AddKeyword : SyntaxKind.RemoveKeyword); 573throw ExceptionUtilities.UnexpectedValue(symbol.MethodKind); 783hasThisParameter: symbol.IsExtensionMethod && symbol.MethodKind != MethodKind.ReducedExtension,
Microsoft.CodeAnalysis.CSharp.CodeStyle (16)
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
87if (context.OwningSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor })
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
174if (owningMethod.MethodKind is not (MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
55if (symbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, Parameters: [var constructorParameter] } ||
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (2)
100MethodKind: MethodKind.Constructor, 132MethodKind: MethodKind.Constructor,
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
79if (method.MethodKind == MethodKind.PropertyGet) 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (2)
71method.MethodKind is MethodKind.PropertyGet or MethodKind.Ordinary && 144=> method.MethodKind != MethodKind.Ordinary
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
15=> conversion is { IsUserDefined: true, MethodSymbol: { MethodKind: MethodKind.Conversion, Name: "op_Implicit" } };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
372MethodKind: MethodKind.ReducedExtension,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
76if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (4)
1111if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1375if (oldSymbolInfo is IMethodSymbol { MethodKind: not (MethodKind.LocalFunction or MethodKind.LambdaMethod) } && 1545if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1546rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
156if (method.MethodKind == MethodKind.Conversion) 162if (method.MethodKind == MethodKind.UserDefinedOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2025while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Microsoft.CodeAnalysis.CSharp.Features (22)
ChangeSignature\CSharpChangeSignatureService.cs (1)
428symbolInfo.Symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension },
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (1)
215switch (symbol.MethodKind)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (4)
936if (symbol is not IMethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor } method) 1977=> symbol.MethodKind switch 2545IMethodSymbol { MethodKind: MethodKind.Destructor } 2549IMethodSymbol { MethodKind: MethodKind.Conversion or MethodKind.UserDefinedOperator }
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
55if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
InlineHints\CSharpInlineTypeHintsService.cs (1)
77if (parameter?.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction } &&
NavigationBar\CSharpNavigationBarItemService.cs (1)
182return method.MethodKind is MethodKind.PropertyGet or MethodKind.PropertySet;
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_DelegateAndFunctionPointerInvoke.cs (1)
64if (invokeMethod.MethodKind == MethodKind.FunctionPointerSignature)
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
75methodGroup = methodGroup.Where(m => m.IsStatic || m is IMethodSymbol { MethodKind: MethodKind.LocalFunction });
SignatureHelp\WithElementSignatureHelpProvider.cs (1)
87var items = creationMethods.SelectAsArray(c => c.MethodKind == MethodKind.Constructor
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
87if (context.OwningSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor })
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
174if (owningMethod.MethodKind is not (MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
55if (symbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, Parameters: [var constructorParameter] } ||
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (2)
100MethodKind: MethodKind.Constructor, 132MethodKind: MethodKind.Constructor,
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
79if (method.MethodKind == MethodKind.PropertyGet) 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (2)
71method.MethodKind is MethodKind.PropertyGet or MethodKind.Ordinary && 144=> method.MethodKind != MethodKind.Ordinary
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
106Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
Microsoft.CodeAnalysis.CSharp.Workspaces (15)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
255if (methodSymbol.MethodKind == MethodKind.Constructor) 261if (methodSymbol.MethodKind == MethodKind.ReducedExtension)
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.cs (1)
48if (symbolInfo.Symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator })
Recommendations\CSharpRecommendationServiceRunner.cs (1)
773if (symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction })
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (1)
33if (member is not IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } method)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
15=> conversion is { IsUserDefined: true, MethodSymbol: { MethodKind: MethodKind.Conversion, Name: "op_Implicit" } };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
372MethodKind: MethodKind.ReducedExtension,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
76if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (4)
1111if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1375if (oldSymbolInfo is IMethodSymbol { MethodKind: not (MethodKind.LocalFunction or MethodKind.LambdaMethod) } && 1545if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1546rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
156if (method.MethodKind == MethodKind.Conversion) 162if (method.MethodKind == MethodKind.UserDefinedOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2025while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Microsoft.CodeAnalysis.Extensions.Package (34)
Symbols\IMethodSymbolExtensions.cs (1)
79if (symbol.MethodKind == MethodKind.BuiltinOperator)
Symbols\INamedTypeSymbolExtensions.cs (5)
242if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 440if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 441method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 651IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true, 652IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } => true,
Symbols\IParameterSymbolExtensions.cs (2)
33MethodKind: MethodKind.Constructor, 65MethodKind: MethodKind.Constructor,
Symbols\ISymbolExtensions.cs (13)
201MethodKind: MethodKind.Ordinary or 241=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 268=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 278=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 287=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 290=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 293=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 296=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 299=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 302=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 305=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 646=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
Symbols\SignatureComparer.cs (5)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction) 91if (method1.MethodKind != method2.MethodKind ||
Symbols\SymbolEquivalenceComparer.cs (2)
202if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 207if (x.MethodKind == MethodKind.FunctionPointerSignature)
Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
172if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction)
Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
Microsoft.CodeAnalysis.Features (58)
AddImport\AbstractAddImportCodeRefactoringProvider.cs (1)
144if (parentSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructor &&
ChangeSignature\AbstractChangeSignatureService.cs (2)
271if (methodSymbol is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet }) 311if (methodSymbol.MethodKind == MethodKind.DelegateInvoke)
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (1)
38=> symbol.MethodKind == MethodKind.DelegateInvoke;
CodeLens\CodeLensFindReferenceProgress.cs (1)
122(definition as IMethodSymbol)?.MethodKind == MethodKind.Constructor;
CodeLens\CodeLensReferencesService.cs (1)
347if (method.MethodKind != MethodKind.AnonymousFunction)
Completion\Providers\AbstractContextVariableArgumentProvider.cs (1)
90while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction })
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
293MethodKind: MethodKind.BuiltinOperator,
Debugging\AbstractDataTipInfoGetter.cs (1)
47MethodKind: MethodKind.ReducedExtension,
DocumentHighlighting\AbstractDocumentHighlightsService.cs (2)
142switch (((IMethodSymbol)symbol).MethodKind) 171if (symbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (15)
344=> symbol.MethodKind switch 3858MethodKind: 4129return oldMethod.MethodKind == MethodKind.StaticConstructor || HasRestartRequiredAttribute(oldMethod); 4345if (oldMethod.MethodKind != newMethod.MethodKind) 4355else if (oldMethod.MethodKind == MethodKind.Conversion) 4359else if (oldMethod.MethodKind == MethodKind.ExplicitInterfaceImplementation || newMethod.MethodKind == MethodKind.ExplicitInterfaceImplementation) 4460if (oldMethod is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: IPropertySymbol oldProperty } && !oldProperty.IsAutoProperty() && 4461newMethod is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: IPropertySymbol newProperty } && newProperty.IsAutoProperty() && 4468if (oldMethod.MethodKind == MethodKind.DeclareMethod || newMethod.MethodKind == MethodKind.DeclareMethod) 5643Contract.ThrowIfFalse(oldCtor is { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor }); 6453var lambda = parameter.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.LambdaMethod or MethodKind.LocalFunction } containingLambda ? 7051=> symbol is IMethodSymbol { IsStatic: false, MethodKind: MethodKind.Constructor, DeclaringSyntaxReferences: [_] } && IsPrimaryConstructorDeclaration(GetSymbolDeclarationSyntax(symbol, cancellationToken));
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
152method.MethodKind == MethodKind.Ordinary &&
ExtractMethod\Extensions.cs (1)
21if (methodSymbol?.MethodKind != MethodKind.AnonymousFunction)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (1)
129.Any(m => m.MethodKind == MethodKind.UserDefinedOperator &&
GoToBase\AbstractGoToBaseService.cs (1)
45if (bases.Length == 0 && symbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
79MethodKind: MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.UserDefinedOperator or MethodKind.Conversion
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
67if (method.MethodKind != MethodKind.Constructor)
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
228if (parameter is not { ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction } method })
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
303if (callerSymbol is IMethodSymbol { MethodKind: MethodKind.Ordinary, IsAsync: false } callerMethodSymbol
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (3)
88var methodKind = methodSymbol.MethodKind; 174if (methodSymbol.MethodKind is not MethodKind.Constructor) 185if (methodSymbol.MethodKind is not MethodKind.LocalFunction)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
720var extension = method.IsExtensionMethod || method.MethodKind == MethodKind.ReducedExtension;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
50public MethodKind MethodKind => _symbol.MethodKind;
PullMemberUp\MemberAndDestinationValidator.cs (1)
47IMethodSymbol { MethodKind: MethodKind.Ordinary } => true,
Rename\SymbolicRenameInfo.cs (1)
204if (symbol.Kind == SymbolKind.Method && ((IMethodSymbol)symbol).MethodKind == MethodKind.UserDefinedOperator)
RQName\RQNodeBuilder.cs (3)
200if (symbol.MethodKind is MethodKind.UserDefinedOperator or 212if (symbol.MethodKind == MethodKind.Constructor) 216else if (symbol.MethodKind == MethodKind.Destructor)
Shared\Extensions\ISymbolExtensions_2.cs (3)
100if (methodSymbol.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion or MethodKind.BuiltinOperator) 105methodSymbol.MethodKind == MethodKind.ReducedExtension || 253switch (method.MethodKind)
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (1)
17methodSymbol.MethodKind == MethodKind.Constructor &&
src\roslyn\src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
146return symbol == null || symbol.IsStatic || symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction };
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
949switch (methodSymbol.MethodKind)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction)
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
139var isConstructorInitializer = candidates.All(m => m.MethodKind == MethodKind.Constructor);
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (3)
141if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count) 167if (method.MethodKind != MethodKind.Constructor) 193if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, DeclaringSyntaxReferences: [var reference] } constructor)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
365return method1.MethodKind == MethodKind.Ordinary && 366method2.MethodKind == MethodKind.Ordinary &&
Microsoft.CodeAnalysis.ResxSourceGenerator (55)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (8)
165return method is { Name: "Dispose", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters.IsEmpty: true }; 185Name: "Dispose", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters: [{ Type.SpecialType: SpecialType.System_Boolean, RefKind: RefKind.None }] 194return method is { Name: "Close", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters.IsEmpty: true }; 213method.MethodKind == MethodKind.Ordinary && 226method.MethodKind == MethodKind.Ordinary && 239method.MethodKind == MethodKind.Ordinary && 467return method.MethodKind switch 476return method.MethodKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
323switch (operation.TargetMethod.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
46return method.MethodKind is MethodKind.Ordinary or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
167switch (((IMethodSymbol)currentSymbol).MethodKind) 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
323IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
143if (symbol.MethodKind == MethodKind.Conversion)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
371switch (methodSymbol.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
408if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 478if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol && 479newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol) 875=> symbol is IMethodSymbol { MethodKind: MethodKind.DelegateInvoke };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (1)
79if (symbol.MethodKind == MethodKind.BuiltinOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (5)
242if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 440if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 441method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 651IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true, 652IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (2)
33MethodKind: MethodKind.Constructor, 65MethodKind: MethodKind.Constructor,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (13)
201MethodKind: MethodKind.Ordinary or 241=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 268=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 278=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 287=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 290=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 293=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 296=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 299=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 302=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 305=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 646=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (5)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction) 91if (method1.MethodKind != method2.MethodKind ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
202if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 207if (x.MethodKind == MethodKind.FunctionPointerSignature)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
172if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
Microsoft.CodeAnalysis.VisualBasic (16)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (13)
170If symbol.MethodKind = MethodKind.ReducedExtension AndAlso Format.ExtensionMethodStyle = SymbolDisplayExtensionMethodStyle.StaticMethod Then 172ElseIf symbol.MethodKind <> MethodKind.ReducedExtension AndAlso Format.ExtensionMethodStyle = SymbolDisplayExtensionMethodStyle.InstanceMethod Then 196Select Case symbol.MethodKind 233symbol.MethodKind = MethodKind.EventAdd, 236symbol.MethodKind = MethodKind.EventRemove, 284Throw ExceptionUtilities.UnexpectedValue(symbol.MethodKind) 296If symbol.MethodKind = MethodKind.ReducedExtension Then 310Select Case symbol.MethodKind 375Throw ExceptionUtilities.UnexpectedValue(symbol.MethodKind) 383If symbol.MethodKind = MethodKind.BuiltinOperator Then 427AddParametersIfRequired(isExtensionMethod:=method.IsExtensionMethod AndAlso method.MethodKind <> MethodKind.ReducedExtension, 435Select Case method.MethodKind 701DirectCast(symbol, IMethodSymbol).MethodKind = MethodKind.AnonymousFunction OrElse
Symbols\MethodSymbol.vb (1)
957Private ReadOnly Property IMethodSymbol_MethodKind As MethodKind Implements IMethodSymbol.MethodKind
Symbols\NamedTypeSymbol.vb (2)
423Debug.Assert(method.MethodKind = MethodKind.Constructor) 431Debug.Assert(method.MethodKind = MethodKind.StaticConstructor)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
159methodSymbol?.MethodKind = MethodKind.Ordinary AndAlso 397If method.MethodKind = MethodKind.ReducedExtension AndAlso
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (4)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
183Return If(methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.Constructor, methodSymbol, Nothing)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
152If method.MethodKind = MethodKind.UserDefinedOperator Then 156If method.MethodKind = MethodKind.Conversion Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (1)
19If symbol.IsStatic AndAlso Not symbol.MethodKind = MethodKind.ReducedExtension Then
Microsoft.CodeAnalysis.VisualBasic.Features (12)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
359If methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.ReducedExtension Then
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (2)
164If methodSymbol.MethodKind = MethodKind.PropertyGet Then 166ElseIf methodSymbol.MethodKind = MethodKind.PropertySet Then
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (5)
619If method Is Nothing OrElse (method.MethodKind <> MethodKind.Constructor AndAlso method.MethodKind <> MethodKind.SharedConstructor) Then 1428Select Case symbol.MethodKind 2022If method.MethodKind = MethodKind.Conversion OrElse method.MethodKind = MethodKind.UserDefinedOperator Then
NavigationBar\VisualBasicNavigationBarItemService.vb (3)
276Return method.MethodKind = MethodKind.Ordinary OrElse 277method.MethodKind = MethodKind.UserDefinedOperator OrElse 278method.MethodKind = MethodKind.Conversion
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
183Return If(methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.Constructor, methodSymbol, Nothing)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (11)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (1)
169(symbol.IsKind(SymbolKind.Method) AndAlso DirectCast(symbol, IMethodSymbol).MethodKind = MethodKind.Constructor)
Classification\SyntaxClassification\NameSyntaxClassifier.vb (1)
211Select Case methodSymbol.MethodKind
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.vb (1)
42DirectCast(symbolInfo.Symbol, IMethodSymbol).MethodKind = MethodKind.UserDefinedOperator Then
CodeCleanup\Providers\AddMissingTokensCodeCleanupProvider.vb (1)
125Function(s) If(TryCast(s, IMethodSymbol)?.MethodKind = MethodKind.Ordinary, False))
Recommendations\VisualBasicRecommendationServiceRunner.vb (2)
343symbols = symbols.WhereAsArray(Function(s) s.Kind <> SymbolKind.Method OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.UserDefinedOperator) 382If method IsNot Nothing AndAlso method.MethodKind = MethodKind.Constructor Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
159methodSymbol?.MethodKind = MethodKind.Ordinary AndAlso 397If method.MethodKind = MethodKind.ReducedExtension AndAlso
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
152If method.MethodKind = MethodKind.UserDefinedOperator Then 156If method.MethodKind = MethodKind.Conversion Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (1)
19If symbol.IsStatic AndAlso Not symbol.MethodKind = MethodKind.ReducedExtension Then
Microsoft.CodeAnalysis.Workspaces (80)
Editing\SyntaxGenerator.cs (4)
281if (method.MethodKind is not (MethodKind.UserDefinedOperator or MethodKind.Conversion)) 282throw new ArgumentException($"Method kind '{method.MethodKind}' is not an operator."); 743switch (method.MethodKind) 881switch (method.MethodKind)
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (3)
26=> symbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor; 30if (symbol.MethodKind is MethodKind.Constructor) 84if (symbol.MethodKind == MethodKind.Constructor)
FindSymbols\FindReferences\Finders\DestructorSymbolReferenceFinder.cs (1)
16=> symbol.MethodKind == MethodKind.Destructor;
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
20=> symbol is { MethodKind: MethodKind.Conversion, Name: WellKnownMemberNames.ExplicitConversionName or WellKnownMemberNames.ImplicitConversionName } &&
FindSymbols\FindReferences\Finders\ExplicitInterfaceMethodReferenceFinder.cs (1)
16=> symbol.MethodKind == MethodKind.ExplicitInterfaceImplementation;
FindSymbols\FindReferences\Finders\ExplicitOrImplicitConstructorInitializerSymbolReferenceFinder.cs (1)
18=> symbol.MethodKind == MethodKind.Constructor;
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
75ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.LocalFunction },
FindSymbols\FindReferences\Finders\OperatorSymbolReferenceFinder.cs (1)
19=> symbol.MethodKind is MethodKind.UserDefinedOperator or MethodKind.BuiltinOperator;
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (1)
24=> symbol.MethodKind is MethodKind.Ordinary or
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (2)
175if (declaredSymbol is IMethodSymbol { MethodKind: not MethodKind.AnonymousFunction }) 213if (containingMethod.MethodKind == MethodKind.DelegateInvoke)
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (1)
18=> symbol.MethodKind.IsPropertyAccessor();
FindSymbols\ReferenceLocationExtensions.cs (1)
99if (method.MethodKind != MethodKind.AnonymousFunction)
ReassignedVariable\AbstractReassignedVariableService.cs (1)
184if (methodOrProperty is IMethodSymbol { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet } method)
Recommendations\AbstractRecommendationService.cs (1)
84switch (((IMethodSymbol)symbol).MethodKind)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
68if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.AnonymousFunction } owningMethod)
Rename\RenameUtilities.cs (2)
353if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion } && 395if (symbol is IMethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor or MethodKind.Destructor })
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (2)
211MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor or MethodKind.Destructor, 297var referencedSymbolName = referencedSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructorSymbol
Shared\Extensions\ISymbolExtensions.cs (1)
474if (methodSymbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor)
Shared\Extensions\ISymbolExtensions_2.cs (1)
17if (method.MethodKind is MethodKind.EventAdd or
Shared\Extensions\SemanticModelExtensions.cs (1)
53methodSymbol.MethodKind == MethodKind.BuiltinOperator &&
Shared\Extensions\SyntaxGeneratorExtensions.cs (1)
242if (overriddenMethod.IsAbstract || overriddenMethod.MethodKind == MethodKind.UserDefinedOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
323switch (operation.TargetMethod.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
46return method.MethodKind is MethodKind.Ordinary or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
167switch (((IMethodSymbol)currentSymbol).MethodKind) 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
323IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
143if (symbol.MethodKind == MethodKind.Conversion)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
371switch (methodSymbol.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
408if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 478if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol && 479newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol) 875=> symbol is IMethodSymbol { MethodKind: MethodKind.DelegateInvoke };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (1)
79if (symbol.MethodKind == MethodKind.BuiltinOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (5)
242if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 440if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 441method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 651IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true, 652IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (2)
33MethodKind: MethodKind.Constructor, 65MethodKind: MethodKind.Constructor,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (13)
201MethodKind: MethodKind.Ordinary or 241=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 268=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 278=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 287=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 290=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 293=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 296=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 299=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 302=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 305=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 646=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (5)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction) 91if (method1.MethodKind != method2.MethodKind ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
202if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 207if (x.MethodKind == MethodKind.FunctionPointerSignature)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
172if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
375methodKind: accessor.MethodKind, 536methodKind: method.MethodKind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (2)
168return [.. this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)]; 177return [.. this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic)];
Microsoft.DotNet.ApiCompatibility (6)
Rules\CannotAddMemberToInterface.cs (4)
51symbol.MethodKind == MethodKind.PropertyGet || 52symbol.MethodKind == MethodKind.PropertySet || 53symbol.MethodKind == MethodKind.EventAdd || 54symbol.MethodKind == MethodKind.EventRemove;
Rules\MembersMustExist.cs (2)
99if (method.MethodKind == MethodKind.ExplicitInterfaceImplementation) 113if (method.MethodKind == MethodKind.Constructor)
Microsoft.DotNet.ApiSymbolExtensions (12)
Filtering\ImplicitSymbolFilter.cs (8)
26method.MethodKind == MethodKind.PropertyGet || 27method.MethodKind == MethodKind.PropertySet || 28method.MethodKind == MethodKind.EventAdd || 29method.MethodKind == MethodKind.EventRemove || 30method.MethodKind == MethodKind.EventRaise || 31method.MethodKind == MethodKind.DelegateInvoke) 38if (method.MethodKind == MethodKind.ExplicitInterfaceImplementation && 39method.ExplicitInterfaceImplementations.Any(m => m is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet or MethodKind.EventAdd or MethodKind.EventRemove }))
SymbolExtensions.cs (4)
80symbol is IMethodSymbol method && method.MethodKind == MethodKind.ExplicitInterfaceImplementation || 127method.MethodKind == MethodKind.EventAdd || 128method.MethodKind == MethodKind.EventRemove || 155method.MethodKind == MethodKind.Constructor &&
Microsoft.Gen.Logging (1)
Parsing\Parser.Records.cs (1)
72if (m is not IMethodSymbol { MethodKind: MethodKind.Constructor } ctorMethod)
Microsoft.Interop.ComInterfaceGenerator (3)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
68if (method.MethodKind != MethodKind.Ordinary)
ComMethodInfo.cs (2)
58case IMethodSymbol { MethodKind: MethodKind.Ordinary }: 89Debug.Assert(method is { IsStatic: false, MethodKind: MethodKind.Ordinary });
Roslyn.Diagnostics.Analyzers (60)
DoNotMixAttributesFromDifferentVersionsOfMEF.cs (1)
103if (member is IMethodSymbol methodSymbol && methodSymbol.MethodKind == MethodKind.Constructor)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (8)
165return method is { Name: "Dispose", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters.IsEmpty: true }; 185Name: "Dispose", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters: [{ Type.SpecialType: SpecialType.System_Boolean, RefKind: RefKind.None }] 194return method is { Name: "Close", MethodKind: MethodKind.Ordinary, ReturnsVoid: true, Parameters.IsEmpty: true }; 213method.MethodKind == MethodKind.Ordinary && 226method.MethodKind == MethodKind.Ordinary && 239method.MethodKind == MethodKind.Ordinary && 467return method.MethodKind switch 476return method.MethodKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
323switch (operation.TargetMethod.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
46return method.MethodKind is MethodKind.Ordinary or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
167switch (((IMethodSymbol)currentSymbol).MethodKind) 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
323IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
143if (symbol.MethodKind == MethodKind.Conversion)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
371switch (methodSymbol.MethodKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
408if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 478if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol && 479newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol) 875=> symbol is IMethodSymbol { MethodKind: MethodKind.DelegateInvoke };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (1)
79if (symbol.MethodKind == MethodKind.BuiltinOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (5)
242if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 440if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 441method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 651IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true, 652IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (2)
33MethodKind: MethodKind.Constructor, 65MethodKind: MethodKind.Constructor,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (13)
201MethodKind: MethodKind.Ordinary or 241=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 268=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 278=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 287=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 290=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 293=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 296=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 299=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 302=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 305=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 646=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (5)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction) 91if (method1.MethodKind != method2.MethodKind ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (2)
202if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 207if (x.MethodKind == MethodKind.FunctionPointerSignature)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
172if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
375methodKind: accessor.MethodKind, 536methodKind: method.MethodKind,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (2)
168return [.. this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)]; 177return [.. this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic)];
Roslyn.Diagnostics.CSharp.Analyzers (11)
CSharpDoNotCapturePrimaryContructorParameters.cs (1)
41if (operation.Parameter.ContainingSymbol == context.ContainingSymbol || operation.Parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
15=> conversion is { IsUserDefined: true, MethodSymbol: { MethodKind: MethodKind.Conversion, Name: "op_Implicit" } };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
372MethodKind: MethodKind.ReducedExtension,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
76if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (4)
1111if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1375if (oldSymbolInfo is IMethodSymbol { MethodKind: not (MethodKind.LocalFunction or MethodKind.LambdaMethod) } && 1545if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1546rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
156if (method.MethodKind == MethodKind.Conversion) 162if (method.MethodKind == MethodKind.UserDefinedOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2025while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Roslyn.Diagnostics.VisualBasic.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
159methodSymbol?.MethodKind = MethodKind.Ordinary AndAlso 397If method.MethodKind = MethodKind.ReducedExtension AndAlso
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
152If method.MethodKind = MethodKind.UserDefinedOperator Then 156If method.MethodKind = MethodKind.Conversion Then