4 implementations of MethodKind
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
77public virtual MethodKind MethodKind => MethodKind.Ordinary;
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\MethodSymbol.cs (1)
33MethodKind IMethodSymbol.MethodKind
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
923Private ReadOnly Property IMethodSymbol_MethodKind As MethodKind Implements IMethodSymbol.MethodKind
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
77public virtual MethodKind MethodKind => MethodKind.Ordinary;
440 references to MethodKind
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (1)
111IMethodReferenceOperation m when m.Method.MethodKind == MethodKind.Constructor => m.Method.ContainingType,
ILLink.RoslynAnalyzer (16)
DataFlow\LocalDataFlowAnalysis.cs (1)
82 methodSymbol.MethodKind is not (MethodKind.LambdaMethod or MethodKind.LocalFunction));
DataFlow\LocalDataFlowVisitor.cs (3)
574 Debug.Assert (localFunction.MethodKind == MethodKind.LocalFunction); 717 Debug.Assert (lambda.MethodKind == MethodKind.LambdaMethod); 824 Debug.Assert (localFunction.MethodKind == MethodKind.LocalFunction);
DynamicallyAccessedMembersAnalyzer.cs (4)
281 if ((methodSymbol.MethodKind != MethodKind.PropertyGet && methodSymbol.MethodKind != MethodKind.PropertySet) 288 if (methodSymbol.MethodKind == MethodKind.PropertyGet 291 || methodSymbol.MethodKind == MethodKind.PropertySet
ISymbolExtensions.cs (2)
202 => (symbol as IMethodSymbol)?.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor; 205 => (symbol as IMethodSymbol)?.MethodKind == MethodKind.StaticConstructor;
TrimAnalysis\FlowAnnotations.cs (2)
159 if (parameterMethod!.MethodKind == MethodKind.PropertySet 180 if (method.MethodKind is MethodKind.PropertyGet && returnDamt == DynamicallyAccessedMemberTypes.None) {
TrimAnalysis\HandleCallAction.cs (2)
236 if (method.Method.MethodKind == MethodKind.PropertyGet || method.Method.MethodKind == MethodKind.PropertySet) {
TrimAnalysis\MethodReturnValue.cs (1)
22 Debug.Assert (!isNewObj || methodSymbol.MethodKind == MethodKind.Constructor, "isNewObj can only be true for constructors");
TrimAnalysis\TrimAnalysisVisitor.cs (1)
364 if (method.MethodKind != MethodKind.PropertyGet)
Microsoft.Analyzers.Local (1)
ApiLifecycle\AssemblyAnalysis.cs (1)
208return method.MethodKind
Microsoft.AspNetCore.App.Analyzers (1)
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\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\Shared\Roslyn\MvcFacts.cs (1)
62if (method.MethodKind != MethodKind.Ordinary)
Microsoft.CodeAnalysis (11)
CodeGen\CompilationTestData.cs (1)
128var format = (iMethod.MethodKind == MethodKind.UserDefinedOperator) ?
Compilation\Compilation.cs (2)
1523/// Creates an <see cref="IMethodSymbol"/> whose <see cref="IMethodSymbol.MethodKind"/> is <see 1551/// Creates an <see cref="IMethodSymbol"/> whose <see cref="IMethodSymbol.MethodKind"/> is <see
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)
223/// Modifier types that are considered part of the calling convention of this method, if the <see cref="MethodKind"/> is <see cref="MethodKind.FunctionPointerSignature"/> 233/// If this method has <see cref="MethodKind"/> of <see cref="MethodKind.PropertyGet"/> or <see cref="MethodKind.PropertySet"/>, 235/// 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.CodeStyle (53)
src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (1)
19methodSymbol.MethodKind == MethodKind.Constructor &&
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
149return symbol == null || symbol.IsStatic || symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction };
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
727switch (methodSymbol.MethodKind)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (1)
50if (symbol.MethodKind == MethodKind.BuiltinOperator)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (4)
226if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 426if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 427method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 637IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (2)
30MethodKind: MethodKind.Constructor, 62MethodKind: MethodKind.Constructor,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (13)
138if (methodSymbol.MethodKind is MethodKind.Ordinary or 178=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 205=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 214=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 223=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 226=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 229=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 232=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 235=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 238=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 241=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 550=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 553=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (3)
154((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator && 163Debug.Assert(!(symbol.IsKind(SymbolKind.Method) && ((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator && symbol.ContainingSymbol.IsKind(SymbolKind.FunctionPointerType))); 165((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
324switch (operation.TargetMethod.MethodKind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
48return method.MethodKind is MethodKind.Ordinary or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
172switch (((IMethodSymbol)currentSymbol).MethodKind) 368SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
319IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
144if (symbol.MethodKind == MethodKind.Conversion)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
368switch (methodSymbol.MethodKind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
388if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 458if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol && 459newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol) 876((IMethodSymbol)symbol).MethodKind == MethodKind.DelegateInvoke;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (5)
77if ((method1.MethodKind == MethodKind.AnonymousFunction) != 78(method2.MethodKind == MethodKind.AnonymousFunction)) 83if (method1.MethodKind != MethodKind.AnonymousFunction) 89if (method1.MethodKind != method2.MethodKind ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (2)
200if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 205if (x.MethodKind == MethodKind.FunctionPointerSignature)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
171if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 176if (x.MethodKind == MethodKind.ReducedExtension) 195if (x.MethodKind is MethodKind.AnonymousFunction or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
112if (x.MethodKind == MethodKind.AnonymousFunction)
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
129var isConstructorInitializer = candidates.All(m => m.MethodKind == MethodKind.Constructor);
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
132if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
368return method1.MethodKind == MethodKind.Ordinary && 369method2.MethodKind == MethodKind.Ordinary &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
379methodKind: accessor.MethodKind, 540methodKind: method.MethodKind,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (2)
174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)); 184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
Microsoft.CodeAnalysis.CSharp (14)
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
109Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
SymbolDisplay\SymbolDisplayVisitor.cs (1)
381return ((IMethodSymbol)symbol).MethodKind == MethodKind.LocalFunction;
SymbolDisplay\SymbolDisplayVisitor.Members.cs (12)
272if (symbol.MethodKind == MethodKind.AnonymousFunction) 279else if (symbol.MethodKind == MethodKind.FunctionPointerSignature) 287if (symbol.MethodKind == MethodKind.ReducedExtension && Format.ExtensionMethodStyle == SymbolDisplayExtensionMethodStyle.StaticMethod) 291else if (symbol.MethodKind != MethodKind.ReducedExtension && Format.ExtensionMethodStyle == SymbolDisplayExtensionMethodStyle.InstanceMethod) 315switch (symbol.MethodKind) 378if (symbol.MethodKind == MethodKind.LocalFunction) 383else if (symbol.MethodKind == MethodKind.ReducedExtension) 413switch (symbol.MethodKind) 441AddKeyword(symbol.MethodKind == MethodKind.PropertyGet ? SyntaxKind.GetKeyword : 456AddKeyword(symbol.MethodKind == MethodKind.EventAdd ? SyntaxKind.AddKeyword : SyntaxKind.RemoveKeyword); 564throw ExceptionUtilities.UnexpectedValue(symbol.MethodKind); 774hasThisParameter: symbol.IsExtensionMethod && symbol.MethodKind != MethodKind.ReducedExtension,
Microsoft.CodeAnalysis.CSharp.CodeStyle (14)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
88if (context.OwningSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor })
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
176if (owningMethod.MethodKind is not (MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet)
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
60MethodKind: MethodKind.Constructor,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
79if (method.MethodKind == MethodKind.PropertyGet) 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (2)
70method.MethodKind is MethodKind.PropertyGet or MethodKind.Ordinary && 143=> method.MethodKind != MethodKind.Ordinary
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
19conversion.MethodSymbol.MethodKind == MethodKind.Conversion &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
378MethodKind: MethodKind.ReducedExtension,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
67if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (4)
921if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1137method.MethodKind is not (MethodKind.LocalFunction or MethodKind.LambdaMethod) && 1307if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1308rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
156if (method.MethodKind == MethodKind.Conversion) 162if (method.MethodKind == MethodKind.UserDefinedOperator)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2011while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenTupleTest.cs (1)
14341Assert.Equal(MethodKind.ReducedExtension, m6Method.MethodKind);
Microsoft.CodeAnalysis.CSharp.Features (19)
ChangeSignature\CSharpChangeSignatureService.cs (1)
426symbolInfo.Symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension },
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.CompletionSymbolDisplay.cs (1)
55switch (symbol.MethodKind)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (4)
947if (symbol is not IMethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor } method) 1985=> symbol.MethodKind switch 2548IMethodSymbol { MethodKind: MethodKind.Destructor } 2552IMethodSymbol { MethodKind: MethodKind.Conversion or MethodKind.UserDefinedOperator }
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
59if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
InlineHints\CSharpInlineTypeHintsService.cs (1)
82if (parameter?.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction } &&
NavigationBar\CSharpNavigationBarItemService.cs (1)
185return 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 });
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
88if (context.OwningSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor })
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
176if (owningMethod.MethodKind is not (MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet)
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
60MethodKind: MethodKind.Constructor,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
79if (method.MethodKind == MethodKind.PropertyGet) 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (2)
70method.MethodKind is MethodKind.PropertyGet or MethodKind.Ordinary && 143=> method.MethodKind != MethodKind.Ordinary
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
109Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (22)
Semantics\DelegateTypeTests.cs (3)
902Assert.Equal(MethodKind.LambdaMethod, method.MethodKind); 945Assert.Equal(MethodKind.LambdaMethod, method.MethodKind); 7135Assert.Equal(MethodKind.LambdaMethod, method.MethodKind);
Semantics\LambdaTests.cs (5)
858Assert.Equal(MethodKind.AnonymousFunction, (sym as IMethodSymbol).MethodKind); 868Assert.Equal(MethodKind.AnonymousFunction, (sym as IMethodSymbol).MethodKind); 3044Assert.Equal(MethodKind.AnonymousFunction, lambda.MethodKind); 3051Assert.Equal(MethodKind.AnonymousFunction, lambda.MethodKind); 5649Assert.Equal(MethodKind.LambdaMethod, method.MethodKind);
Semantics\LocalFunctionTests.cs (1)
1063Assert.Equal(MethodKind.Constructor, attrConstructor.MethodKind);
Semantics\NativeIntegerTests.cs (2)
325switch (method.MethodKind) 345return !(nativeIntegerMember is IMethodSymbol { MethodKind: MethodKind.Constructor });
Semantics\OperatorTests.cs (3)
7618Assert.Equal(MethodKind.BuiltinOperator, symbol1.MethodKind); 8291Assert.Equal(MethodKind.UserDefinedOperator, symbol1.MethodKind); 8394Assert.Equal(MethodKind.BuiltinOperator, symbol1.MethodKind);
Semantics\QueryTests.cs (4)
1462Assert.NotEqual(MethodKind.ReducedExtension, ((IMethodSymbol)info0.CastInfo.Symbol).MethodKind); 1471Assert.NotEqual(MethodKind.ReducedExtension, ((IMethodSymbol)info1.OperationInfo.Symbol).MethodKind); 1671Assert.Equal(MethodKind.ReducedExtension, ((IMethodSymbol)info0.CastInfo.Symbol).MethodKind); 1680Assert.Equal(MethodKind.ReducedExtension, ((IMethodSymbol)info1.OperationInfo.Symbol).MethodKind);
Semantics\TopLevelStatementsTests.cs (1)
4221Assert.Equal(MethodKind.LocalFunction, ((IMethodSymbol)local).MethodKind);
Semantics\UnsafeTests.cs (2)
8873Assert.Equal(MethodKind.BuiltinOperator, summaryMethod.MethodKind); 9335Assert.Equal(MethodKind.BuiltinOperator, summaryMethod.MethodKind);
Semantics\Utf8StringsLiteralsTests.cs (1)
4084Assert.Equal(MethodKind.BuiltinOperator, method.MethodKind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (40)
Compilation\GetSemanticInfoTests.cs (7)
1074Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)baseConstructor).MethodKind); 1093Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)baseConstructor).MethodKind); 1116Assert.Equal(MethodKind.Constructor, invokedConstructor.MethodKind); 1172Assert.Equal(MethodKind.EventAdd, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 1201Assert.Equal(MethodKind.EventRemove, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 2360Assert.Equal(MethodKind.AnonymousFunction, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 2542Assert.Equal(MethodKind.Conversion, ((IMethodSymbol)symbol.ContainingSymbol).MethodKind);
Compilation\SemanticModelAPITests.cs (3)
1371Assert.Equal(MethodKind.Constructor, method.MethodKind); 2087Assert.Equal(MethodKind.Constructor, method.MethodKind); 2104Assert.Equal(MethodKind.Constructor, method.MethodKind);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (5)
1722symbol.Kind == SymbolKind.Method && (((IMethodSymbol)symbol).IsExtensionMethod || ((IMethodSymbol)symbol).MethodKind == MethodKind.ReducedExtension); 1885symbol.Kind == SymbolKind.Method && (((IMethodSymbol)symbol).IsExtensionMethod || ((IMethodSymbol)symbol).MethodKind == MethodKind.ReducedExtension); 2854Assert.Equal(MethodKind.ExplicitInterfaceImplementation, explicitMethodSymbol.MethodKind); 2874Assert.Equal(MethodKind.PropertyGet, explicitPropertyGetterSymbol.MethodKind); 2884Assert.Equal(MethodKind.PropertySet, explicitPropertySetterSymbol.MethodKind);
Compilation\SemanticModelGetSemanticInfoTests.cs (5)
4886Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol.ContainingSymbol).MethodKind); 4893Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol.ContainingSymbol).MethodKind); 5413Assert.Equal(MethodKind.PropertySet, ((IMethodSymbol)sortedCandidates[0]).MethodKind); 6373Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)symbol).MethodKind); 7295Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol).MethodKind);
DocumentationComments\CrefTests.cs (5)
3230Assert.Equal(MethodKind.Ordinary, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 3278Assert.Equal(MethodKind.Conversion, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 3302Assert.Equal(MethodKind.UserDefinedOperator, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 3326Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 5718Assert.Equal(MethodKind.UserDefinedOperator, ((IMethodSymbol)symbol).MethodKind);
SymbolDisplay\SymbolDisplayTests.cs (4)
6442Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind); 6485Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind); 6520Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind); 6614Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind);
Symbols\ConversionTests.cs (2)
1803Assert.Equal(MethodKind.Conversion, method.MethodKind); 1837Assert.Equal(MethodKind.Conversion, method.MethodKind);
Symbols\ExtensionMethodTests.cs (2)
229Assert.Equal(MethodKind.ReducedExtension, gooSymbol.MethodKind); 232Assert.Equal(MethodKind.Ordinary, gooOriginal.MethodKind);
Symbols\Source\DeclaringSyntaxNodeTests.cs (2)
159Assert.Equal(MethodKind.AnonymousFunction, sym.MethodKind); 523if (memb.Kind == SymbolKind.Method && ((IMethodSymbol)memb).MethodKind == MethodKind.Constructor)
Symbols\Source\MethodTests.cs (1)
120Assert.Equal(MethodKind.Constructor, m.MethodKind);
Symbols\Source\NullablePublicAPITests.cs (4)
3491Assert.Equal(MethodKind.LambdaMethod, lambdaSymbol.MethodKind); 3544Assert.Equal(MethodKind.LambdaMethod, innerLambdaSymbol.MethodKind); 3605Assert.Equal(MethodKind.LambdaMethod, innerLambdaSymbol.MethodKind); 4134var localFunctionResult = lookupResults.OfType<IMethodSymbol>().First(m => m.MethodKind == MethodKind.LocalFunction);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\LambdaUtilitiesTests.cs (1)
49bool expected = enclosingMethod.MethodKind == MethodKind.LambdaMethod && enclosingSyntax.Span.Contains(span.Value);
Microsoft.CodeAnalysis.CSharp.Workspaces (15)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
256if (methodSymbol.MethodKind == MethodKind.Constructor) 264return methodSymbol.MethodKind == MethodKind.ReducedExtension
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.cs (1)
48if (symbolInfo.Symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator })
Recommendations\CSharpRecommendationServiceRunner.cs (1)
677if (symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction })
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (1)
33if (member is not IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } method)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
19conversion.MethodSymbol.MethodKind == MethodKind.Conversion &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
378MethodKind: MethodKind.ReducedExtension,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
67if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (4)
921if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1137method.MethodKind is not (MethodKind.LocalFunction or MethodKind.LambdaMethod) && 1307if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1308rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
156if (method.MethodKind == MethodKind.Conversion) 162if (method.MethodKind == MethodKind.UserDefinedOperator)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
2011while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
2495var method = type.GetMembers().Single(m => m is IMethodSymbol { MethodKind: MethodKind.ExplicitInterfaceImplementation }); 4278var method = symbolC.GetMembers().OfType<IMethodSymbol>().Single(m => m.MethodKind == MethodKind.Ordinary);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Utilities\SymbolEquivalenceComparerTests.cs (2)
1871Assert.Equal(MethodKind.ReducedExtension, method1.MethodKind); 1874Assert.Equal(MethodKind.ReducedExtension, method2.MethodKind);
Microsoft.CodeAnalysis.Features (38)
ChangeSignature\AbstractChangeSignatureService.cs (2)
272if (methodSymbol is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet }) 312if (methodSymbol.MethodKind == MethodKind.DelegateInvoke)
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (1)
38=> symbol.MethodKind == MethodKind.DelegateInvoke;
CodeLens\CodeLensFindReferenceProgress.cs (1)
124(definition as IMethodSymbol)?.MethodKind == MethodKind.Constructor;
CodeLens\CodeLensReferencesService.cs (1)
236if (method.MethodKind != MethodKind.AnonymousFunction)
Completion\Providers\AbstractContextVariableArgumentProvider.cs (1)
90while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction })
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
281MethodKind: MethodKind.BuiltinOperator,
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
142switch (((IMethodSymbol)symbol).MethodKind)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
355=> symbol.MethodKind switch
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
156method.MethodKind == MethodKind.Ordinary &&
ExtractMethod\Extensions.cs (1)
22if (methodSymbol?.MethodKind != MethodKind.AnonymousFunction)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (1)
128.Any(m => m.MethodKind == MethodKind.UserDefinedOperator &&
GoToBase\AbstractGoToBaseService.cs (1)
47if (bases.Length == 0 && symbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
78MethodKind: MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.UserDefinedOperator or MethodKind.Conversion
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
70if (method.MethodKind != MethodKind.Constructor)
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
225if (parameter is not { ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction } method })
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (3)
84var methodKind = methodSymbol.MethodKind; 160if (methodSymbol.MethodKind is not MethodKind.Constructor) 171if (methodSymbol.MethodKind is not MethodKind.LocalFunction)
LanguageServiceIndexFormat\SymbolMoniker.cs (1)
33if (symbol is IMethodSymbol method && method.MethodKind == MethodKind.BuiltinOperator)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
628var extension = method.IsExtensionMethod || method.MethodKind == MethodKind.ReducedExtension;
PullMemberUp\MemberAndDestinationValidator.cs (1)
46IMethodSymbol methodSymbol => methodSymbol.MethodKind == MethodKind.Ordinary,
Rename\SymbolicRenameInfo.cs (1)
206if (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)
98if (methodSymbol.MethodKind is MethodKind.UserDefinedOperator or 105methodSymbol.MethodKind == MethodKind.ReducedExtension) 248switch (method.MethodKind)
src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (1)
19methodSymbol.MethodKind == MethodKind.Constructor &&
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
149return symbol == null || symbol.IsStatic || symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction };
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
727switch (methodSymbol.MethodKind)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
129var isConstructorInitializer = candidates.All(m => m.MethodKind == MethodKind.Constructor);
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
132if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
368return method1.MethodKind == MethodKind.Ordinary && 369method2.MethodKind == MethodKind.Ordinary &&
Microsoft.CodeAnalysis.Test.Utilities (7)
Compilation\CompilationExtensions.cs (1)
383if ((parameterInitializerOperation.Parameter.ContainingSymbol as IMethodSymbol)?.MethodKind is not (MethodKind.LocalFunction or MethodKind.AnonymousFunction))
Compilation\ControlFlowGraphVerifier.cs (2)
1716if (method.MethodKind == MethodKind.LocalFunction) 1731if (method.MethodKind == MethodKind.LocalFunction)
Compilation\TestOperationVisitor.cs (1)
810if (method.MethodKind == MethodKind.BuiltinOperator)
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (2)
48bool inConstructor = containingMethod.MethodKind == MethodKind.Constructor; 49ITypeSymbol staticConstructorType = containingMethod.MethodKind == MethodKind.StaticConstructor ? containingMethod.ContainingType : null;
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
40MethodKind = symbol is IMethodSymbol ? ((IMethodSymbol)symbol).MethodKind : (MethodKind?)null;
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)
923Private ReadOnly Property IMethodSymbol_MethodKind As MethodKind Implements IMethodSymbol.MethodKind
Symbols\NamedTypeSymbol.vb (2)
421Debug.Assert(method.MethodKind = MethodKind.Constructor) 429Debug.Assert(method.MethodKind = MethodKind.StaticConstructor)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (2)
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\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
184Return If(methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.Constructor, methodSymbol, Nothing)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
153If method.MethodKind = MethodKind.UserDefinedOperator Then 157If method.MethodKind = MethodKind.Conversion Then
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)
358If 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)
643If method Is Nothing OrElse (method.MethodKind <> MethodKind.Constructor AndAlso method.MethodKind <> MethodKind.SharedConstructor) Then 1438Select Case symbol.MethodKind 2084If method.MethodKind = MethodKind.Conversion OrElse method.MethodKind = MethodKind.UserDefinedOperator Then
NavigationBar\VisualBasicNavigationBarItemService.vb (3)
277Return method.MethodKind = MethodKind.Ordinary OrElse 278method.MethodKind = MethodKind.UserDefinedOperator OrElse 279method.MethodKind = MethodKind.Conversion
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
184Return 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)
124Function(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\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
159methodSymbol?.MethodKind = MethodKind.Ordinary AndAlso 397If method.MethodKind = MethodKind.ReducedExtension AndAlso
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
153If method.MethodKind = MethodKind.UserDefinedOperator Then 157If method.MethodKind = MethodKind.Conversion Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (1)
19If symbol.IsStatic AndAlso Not symbol.MethodKind = MethodKind.ReducedExtension Then
Microsoft.CodeAnalysis.Workspaces (76)
Editing\SyntaxGenerator.cs (4)
280if (method.MethodKind is not (MethodKind.UserDefinedOperator or MethodKind.Conversion)) 281throw new ArgumentException($"Method kind '{method.MethodKind}' is not an operator."); 735switch (method.MethodKind) 832switch (method.MethodKind)
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (1)
19=> symbol.MethodKind == MethodKind.Constructor;
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (2)
25=> symbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor; 64if (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\OperatorSymbolReferenceFinder.cs (1)
18=> symbol.MethodKind is MethodKind.UserDefinedOperator or MethodKind.BuiltinOperator;
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (1)
16=> 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)
17=> symbol.MethodKind.IsPropertyAccessor();
FindSymbols\ReferenceLocationExtensions.cs (1)
95if (method.MethodKind != MethodKind.AnonymousFunction)
ReassignedVariable\AbstractReassignedVariableService.cs (1)
184if (methodOrProperty is IMethodSymbol { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet } method)
Recommendations\AbstractRecommendationService.cs (1)
87switch (((IMethodSymbol)symbol).MethodKind)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
68if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.AnonymousFunction } owningMethod)
Rename\RenameUtilities.cs (1)
361if (methodSymbol.MethodKind is MethodKind.Constructor or
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
210MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor or MethodKind.Destructor,
Shared\Extensions\ISymbolExtensions.cs (1)
480if (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)
52methodSymbol.MethodKind == MethodKind.BuiltinOperator &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (1)
50if (symbol.MethodKind == MethodKind.BuiltinOperator)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (4)
226if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 426if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 427method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 637IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (2)
30MethodKind: MethodKind.Constructor, 62MethodKind: MethodKind.Constructor,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (13)
138if (methodSymbol.MethodKind is MethodKind.Ordinary or 178=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 205=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 214=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 223=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 226=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 229=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 232=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 235=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 238=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 241=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 550=> (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true; 553=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (3)
154((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator && 163Debug.Assert(!(symbol.IsKind(SymbolKind.Method) && ((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator && symbol.ContainingSymbol.IsKind(SymbolKind.FunctionPointerType))); 165((IMethodSymbol)symbol).MethodKind == MethodKind.BuiltinOperator &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
324switch (operation.TargetMethod.MethodKind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
48return method.MethodKind is MethodKind.Ordinary or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
172switch (((IMethodSymbol)currentSymbol).MethodKind) 368SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
319IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
144if (symbol.MethodKind == MethodKind.Conversion)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
368switch (methodSymbol.MethodKind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
388if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 458if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol && 459newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol) 876((IMethodSymbol)symbol).MethodKind == MethodKind.DelegateInvoke;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (5)
77if ((method1.MethodKind == MethodKind.AnonymousFunction) != 78(method2.MethodKind == MethodKind.AnonymousFunction)) 83if (method1.MethodKind != MethodKind.AnonymousFunction) 89if (method1.MethodKind != method2.MethodKind ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (2)
200if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 205if (x.MethodKind == MethodKind.FunctionPointerSignature)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
171if (!AreCompatibleMethodKinds(x.MethodKind, y.MethodKind)) 176if (x.MethodKind == MethodKind.ReducedExtension) 195if (x.MethodKind is MethodKind.AnonymousFunction or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
112if (x.MethodKind == MethodKind.AnonymousFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
379methodKind: accessor.MethodKind, 540methodKind: method.MethodKind,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (2)
174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)); 184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
UtilityTest\DocumentationCommentIdTests.cs (8)
155CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#cctor", compilation, s => s.MethodKind == MethodKind.StaticConstructor); 156CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#ctor", compilation, s => s.MethodKind == MethodKind.Constructor && s.Parameters.Length == 0); 157CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#ctor(System.String)", compilation, s => s.MethodKind == MethodKind.Constructor && s.Parameters.Length == 1); 174CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.Finalize", compilation, s => s.MethodKind == MethodKind.Destructor); 281CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_UnaryPlus(Acme.Widget)", compilation, m => m.MethodKind == MethodKind.UserDefinedOperator && m.Parameters.Length == 1); 297CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Addition(Acme.Widget,Acme.Widget)", compilation, m => m.MethodKind == MethodKind.UserDefinedOperator && m.Parameters.Length == 2); 314CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Explicit(Acme.Widget)~System.Int32", compilation, m => m.MethodKind == MethodKind.Conversion && m.Parameters.Length == 1 && m.ReturnType.Name == "Int32"); 315CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Implicit(Acme.Widget)~System.Int64", compilation, m => m.MethodKind == MethodKind.Conversion && m.Parameters.Length == 1 && m.ReturnType.Name == "Int64");
Microsoft.Gen.Logging (1)
Parsing\Parser.Records.cs (1)
73if (m is not IMethodSymbol { MethodKind: MethodKind.Constructor } ctorMethod)
Microsoft.Interop.ComInterfaceGenerator (2)
ComMethodInfo.cs (2)
58case IMethodSymbol { MethodKind: MethodKind.Ordinary }: 89Debug.Assert(method is { IsStatic: false, MethodKind: MethodKind.Ordinary });
Microsoft.VisualStudio.LanguageServices (11)
Implementation\VsRefactorNotifyService.cs (1)
165if (methodSymbol.MethodKind is MethodKind.Constructor or
Library\ObjectBrowser\AbstractListItemFactory.cs (1)
346if (methodSymbol.MethodKind is MethodKind.Destructor or MethodKind.Constructor ||
Library\ObjectBrowser\Lists\MemberListItem.cs (1)
42Kind = methodSymbol.MethodKind is MethodKind.Conversion or
Progression\GraphBuilder.cs (6)
386if (methodSymbol.MethodKind == MethodKind.Constructor) 390else if (methodSymbol.MethodKind == MethodKind.StaticConstructor) 394else if (methodSymbol.MethodKind == MethodKind.Destructor) 520switch (symbol.MethodKind) 624var isOperator = method.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion; 630node[RoslynGraphProperties.MethodKind] = method.MethodKind;
Progression\GraphNodeIdCreation.cs (1)
322if (member is IMethodSymbol methodSymbol && methodSymbol.MethodKind == MethodKind.Conversion)
Progression\GraphQueries\CallsGraphQuery.cs (1)
55(newSymbol.CanBeReferencedByName || ((IMethodSymbol)newSymbol).MethodKind == MethodKind.Constructor))
Microsoft.VisualStudio.LanguageServices.CSharp (8)
CodeModel\CSharpCodeModelService.cs (2)
996if (methodSymbol.MethodKind is MethodKind.PropertyGet or 2188switch (symbol.MethodKind)
LanguageService\CSharpHelpContextService.cs (1)
199if (symbol is IMethodSymbol method && method.MethodKind == MethodKind.BuiltinOperator)
ObjectBrowser\DescriptionBuilder.cs (4)
194if (methodSymbol.MethodKind is not MethodKind.Constructor and 203if (methodSymbol.MethodKind == MethodKind.Conversion) 253methodSymbol.MethodKind == MethodKind.Destructor) 268methodSymbol.MethodKind != MethodKind.StaticConstructor)
Progression\CSharpProgressionLanguageService.cs (1)
127=> f.MethodKind is MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation;
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
GlyphExtensionsTests.cs (1)
227methodTypeMock.SetupGet(s => s.MethodKind).Returns(methodKind);
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
238Dim extractableMembers = DirectCast(symbol, INamedTypeSymbol).GetMembers().Where(Function(s) Not (TypeOf s Is IMethodSymbol) OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.Constructor)
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
301Dim extractableMembers = DirectCast(symbol, INamedTypeSymbol).GetMembers().Where(Function(s) Not (TypeOf s Is IMethodSymbol) OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.Constructor)
Microsoft.VisualStudio.LanguageServices.VisualBasic (9)
CodeModel\VisualBasicCodeModelService.vb (6)
1387If methodSymbol.MethodKind = MethodKind.PropertyGet OrElse 1388methodSymbol.MethodKind = MethodKind.PropertySet OrElse 1389methodSymbol.MethodKind = MethodKind.EventAdd OrElse 1390methodSymbol.MethodKind = MethodKind.EventRemove OrElse 1391methodSymbol.MethodKind = MethodKind.EventRaise Then 2543Select Case symbol.MethodKind
CodeModel\VisualBasicCodeModelService_Prototype.vb (1)
96If methodSymbol.MethodKind = MethodKind.Ordinary AndAlso
ObjectBrowser\DescriptionBuilder.vb (2)
115Select Case methodSymbol.MethodKind 341(methodSymbol Is Nothing OrElse Not methodSymbol.MethodKind = MethodKind.DeclareMethod) AndAlso