1967 references to MethodKind
Aspire.Hosting.Integration.Analyzers (4)
AspireExportAnalyzer.cs (4)
680method.MethodKind != MethodKind.Ordinary || 918m is IMethodSymbol { MethodKind: MethodKind.Ordinary } or IPropertySymbol); 983if (invocation.TargetMethod.MethodKind == MethodKind.DelegateInvoke) 1816return method.MethodKind != MethodKind.Ordinary ||
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (1)
111IMethodReferenceOperation m when m.Method.MethodKind == MethodKind.Constructor => m.Method.ContainingType,
GenerateDocumentationAndConfigFiles (122)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (11)
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 && 469MethodKind.LambdaMethod or MethodKind.LocalFunction or MethodKind.DelegateInvoke => true, 478MethodKind.LambdaMethod or MethodKind.LocalFunction => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (3)
325case MethodKind.AnonymousFunction: 326case MethodKind.DelegateInvoke: 338case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
78private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 79private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 283case MethodKind.Ordinary: 286case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
46return method.MethodKind is MethodKind.Ordinary or 47MethodKind.LocalFunction;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (19)
70new SymbolKindOrTypeKind(MethodKind.Ordinary), 71new SymbolKindOrTypeKind(MethodKind.LocalFunction), 169case MethodKind.AnonymousFunction: 170case MethodKind.LocalFunction: 298foreach (var methodKindElement in symbolKindListElement.Elements(nameof(MethodKind))) 349public SymbolKindOrTypeKind(MethodKind methodKind) 356public MethodKind? MethodKind => (_category == SymbolCategory.Method) ? (MethodKind)_kind : null; 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind, 372SymbolCategory.Method => new XElement(nameof(MethodKind), GetMethodKindString((MethodKind)_kind)), 388private static string GetMethodKindString(MethodKind methodKind) 395CodeAnalysis.MethodKind.SharedConstructor => nameof(CodeAnalysis.MethodKind.StaticConstructor), 396CodeAnalysis.MethodKind.AnonymousFunction => nameof(CodeAnalysis.MethodKind.LambdaMethod), 427CodeAnalysis.SymbolKind.Method => new(CodeAnalysis.MethodKind.Ordinary), 436=> new((MethodKind)Enum.Parse(typeof(MethodKind), methodKindElement.Value)); 444public static implicit operator SymbolKindOrTypeKind(MethodKind symbolKind)
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 (2)
76/// cref="IRangeVariableSymbol"/> and <see cref="MethodKind.LocalFunction"/> <see cref="IMethodSymbol"/>s can also 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 (4)
373case MethodKind.AnonymousFunction: 378case MethodKind.BuiltinOperator: 383case MethodKind.ReducedExtension: 388case MethodKind.LocalFunction:
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 (6)
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_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (19)
201MethodKind: MethodKind.Ordinary or 202MethodKind.PropertyGet or 203MethodKind.PropertySet or 204MethodKind.UserDefinedOperator or 205MethodKind.Conversion 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 }; 659=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\MethodKindExtensions.cs (3)
11public static bool IsPropertyAccessor(this MethodKind kind) 12=> kind is MethodKind.PropertyGet or MethodKind.PropertySet;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (3)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction)
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 (11)
184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 249private static bool AreCompatibleMethodKinds(MethodKind kind1, MethodKind kind2) 256if ((kind1 == MethodKind.Ordinary && kind2.IsPropertyAccessor()) || 257(kind1.IsPropertyAccessor() && kind2 == MethodKind.Ordinary)) 263if ((kind1 == MethodKind.BuiltinOperator && kind2 == MethodKind.UserDefinedOperator) || 264(kind1 == MethodKind.UserDefinedOperator && kind2 == MethodKind.BuiltinOperator))
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 (4)
161MethodKind methodKind = MethodKind.Ordinary, 182MethodKind methodKind = MethodKind.Ordinary,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
72public virtual MethodKind MethodKind => MethodKind.Ordinary;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (2)
27public override MethodKind MethodKind => MethodKind.Constructor;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (2)
34public override MethodKind MethodKind => MethodKind.Conversion;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (2)
23public override MethodKind MethodKind => MethodKind.Destructor;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (5)
20public override MethodKind MethodKind { get; } 35MethodKind methodKind = MethodKind.Ordinary, 42Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet); 43this.IsInitOnly = methodKind == MethodKind.PropertySet && isInitOnly;
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)];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (2)
32public override MethodKind MethodKind => MethodKind.UserDefinedOperator;
ILLink.RoslynAnalyzer (18)
DataFlow\LocalDataFlowAnalysis.cs (2)
90methodSymbol.MethodKind is not (MethodKind.LambdaMethod or MethodKind.LocalFunction));
DataFlow\LocalDataFlowVisitor.cs (3)
1223Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction); 1378Debug.Assert(lambda.MethodKind == MethodKind.LambdaMethod); 1525Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction);
DynamicallyAccessedMembersAnalyzer.cs (4)
325if ((methodSymbol.MethodKind != MethodKind.PropertyGet && methodSymbol.MethodKind != MethodKind.PropertySet) 337if (methodSymbol.MethodKind == MethodKind.PropertyGet 340|| methodSymbol.MethodKind == MethodKind.PropertySet
ISymbolExtensions.cs (3)
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)
446if (method.MethodKind != MethodKind.PropertyGet)
Microsoft.Analyzers.Local (4)
ApiLifecycle\AssemblyAnalysis.cs (4)
209is not MethodKind.PropertyGet 210and not MethodKind.PropertySet 211and not MethodKind.EventAdd 212and not MethodKind.EventRemove;
Microsoft.AspNetCore.App.Analyzers (1)
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
62if (method.MethodKind != MethodKind.Ordinary)
Microsoft.AspNetCore.Components.Analyzers (6)
ComponentDisposableSanityAnalyzer.cs (1)
63MethodKind: MethodKind.Ordinary,
InternalUsageAnalyzer.cs (2)
100if (method.MethodKind != MethodKind.PropertyGet) 107if (method.MethodKind != MethodKind.PropertySet)
StateHasChangedAnalyzer.cs (3)
191if (method.MethodKind != MethodKind.Ordinary) 206return method.MethodKind == MethodKind.Ordinary && 214method.MethodKind == MethodKind.Ordinary &&
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.OpenApi.SourceGenerators (3)
XmlCommentGenerator.Parser.cs (1)
100if (method.MethodKind == MethodKind.Constructor)
XmlComments\XmlComment.InheritDoc.cs (2)
282if (methodSymbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor)
Microsoft.CodeAnalysis (17)
CodeGen\CompilationTestData.cs (1)
128var format = (iMethod.MethodKind == MethodKind.UserDefinedOperator) ?
Compilation\Compilation.cs (2)
1560/// cref="MethodKind.BuiltinOperator"/> for a binary operator. Built-in operators are commonly created for 1588/// cref="MethodKind.BuiltinOperator"/> for a unary operator. Built-in operators are commonly created for
Operations\CommonConversion.cs (3)
76public bool IsUserDefined => MethodSymbol is { MethodKind: MethodKind.Conversion }; 86{ MethodKind: MethodKind.Constructor, ContainingType.IsUnion: true } or 88MethodKind: MethodKind.Ordinary, IsStatic: true, Name: WellKnownMemberNames.UnionFactoryMethodName,
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (2)
98Debug.Assert(symbol.MethodKind == MethodKind.LocalFunction); 117Debug.Assert(others.All(((IMethodSymbol m, ILocalFunctionOperation _) tuple) => tuple.m.MethodKind == MethodKind.LocalFunction));
SymbolDisplay\SymbolDisplayExtensionMethodStyle.cs (1)
15/// Displays the extension method based on its <see cref="MethodKind"/>.
Symbols\IMethodSymbol.cs (6)
26MethodKind MethodKind { get; } 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 (122)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (11)
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 && 469MethodKind.LambdaMethod or MethodKind.LocalFunction or MethodKind.DelegateInvoke => true, 478MethodKind.LambdaMethod or MethodKind.LocalFunction => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (3)
325case MethodKind.AnonymousFunction: 326case MethodKind.DelegateInvoke: 338case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
78private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 79private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 283case MethodKind.Ordinary: 286case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
46return method.MethodKind is MethodKind.Ordinary or 47MethodKind.LocalFunction;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (19)
70new SymbolKindOrTypeKind(MethodKind.Ordinary), 71new SymbolKindOrTypeKind(MethodKind.LocalFunction), 169case MethodKind.AnonymousFunction: 170case MethodKind.LocalFunction: 298foreach (var methodKindElement in symbolKindListElement.Elements(nameof(MethodKind))) 349public SymbolKindOrTypeKind(MethodKind methodKind) 356public MethodKind? MethodKind => (_category == SymbolCategory.Method) ? (MethodKind)_kind : null; 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind, 372SymbolCategory.Method => new XElement(nameof(MethodKind), GetMethodKindString((MethodKind)_kind)), 388private static string GetMethodKindString(MethodKind methodKind) 395CodeAnalysis.MethodKind.SharedConstructor => nameof(CodeAnalysis.MethodKind.StaticConstructor), 396CodeAnalysis.MethodKind.AnonymousFunction => nameof(CodeAnalysis.MethodKind.LambdaMethod), 427CodeAnalysis.SymbolKind.Method => new(CodeAnalysis.MethodKind.Ordinary), 436=> new((MethodKind)Enum.Parse(typeof(MethodKind), methodKindElement.Value)); 444public static implicit operator SymbolKindOrTypeKind(MethodKind symbolKind)
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 (2)
76/// cref="IRangeVariableSymbol"/> and <see cref="MethodKind.LocalFunction"/> <see cref="IMethodSymbol"/>s can also 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 (4)
373case MethodKind.AnonymousFunction: 378case MethodKind.BuiltinOperator: 383case MethodKind.ReducedExtension: 388case MethodKind.LocalFunction:
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 (6)
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_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (19)
201MethodKind: MethodKind.Ordinary or 202MethodKind.PropertyGet or 203MethodKind.PropertySet or 204MethodKind.UserDefinedOperator or 205MethodKind.Conversion 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 }; 659=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\MethodKindExtensions.cs (3)
11public static bool IsPropertyAccessor(this MethodKind kind) 12=> kind is MethodKind.PropertyGet or MethodKind.PropertySet;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (3)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction)
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 (11)
184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 249private static bool AreCompatibleMethodKinds(MethodKind kind1, MethodKind kind2) 256if ((kind1 == MethodKind.Ordinary && kind2.IsPropertyAccessor()) || 257(kind1.IsPropertyAccessor() && kind2 == MethodKind.Ordinary)) 263if ((kind1 == MethodKind.BuiltinOperator && kind2 == MethodKind.UserDefinedOperator) || 264(kind1 == MethodKind.UserDefinedOperator && kind2 == MethodKind.BuiltinOperator))
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 (4)
161MethodKind methodKind = MethodKind.Ordinary, 182MethodKind methodKind = MethodKind.Ordinary,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
72public virtual MethodKind MethodKind => MethodKind.Ordinary;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (2)
27public override MethodKind MethodKind => MethodKind.Constructor;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (2)
34public override MethodKind MethodKind => MethodKind.Conversion;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (2)
23public override MethodKind MethodKind => MethodKind.Destructor;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (5)
20public override MethodKind MethodKind { get; } 35MethodKind methodKind = MethodKind.Ordinary, 42Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet); 43this.IsInitOnly = methodKind == MethodKind.PropertySet && isInitOnly;
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)];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (2)
32public override MethodKind MethodKind => MethodKind.UserDefinedOperator;
Microsoft.CodeAnalysis.AnalyzerUtilities (117)
src\2e2796bccd1466f6\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (2)
638if (method.MethodKind == MethodKind.Constructor 695if (method.MethodKind == MethodKind.Constructor
src\683181b2796de991\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (2)
358Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or MethodKind.LocalFunction);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (11)
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 && 469MethodKind.LambdaMethod or MethodKind.LocalFunction or MethodKind.DelegateInvoke => true, 478MethodKind.LambdaMethod or MethodKind.LocalFunction => true,
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisHelper.cs (1)
155containingMethod.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 (9)
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 3348MethodKind.DelegateInvoke); 3473computeValueForInvocation: () => method.MethodKind == MethodKind.LocalFunction ? 3624if (methodReference.Method.MethodKind == MethodKind.LocalFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (3)
325case MethodKind.AnonymousFunction: 326case MethodKind.DelegateInvoke: 338case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
78private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 79private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 283case MethodKind.Ordinary: 286case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
46return method.MethodKind is MethodKind.Ordinary or 47MethodKind.LocalFunction;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (19)
70new SymbolKindOrTypeKind(MethodKind.Ordinary), 71new SymbolKindOrTypeKind(MethodKind.LocalFunction), 169case MethodKind.AnonymousFunction: 170case MethodKind.LocalFunction: 298foreach (var methodKindElement in symbolKindListElement.Elements(nameof(MethodKind))) 349public SymbolKindOrTypeKind(MethodKind methodKind) 356public MethodKind? MethodKind => (_category == SymbolCategory.Method) ? (MethodKind)_kind : null; 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind, 372SymbolCategory.Method => new XElement(nameof(MethodKind), GetMethodKindString((MethodKind)_kind)), 388private static string GetMethodKindString(MethodKind methodKind) 395CodeAnalysis.MethodKind.SharedConstructor => nameof(CodeAnalysis.MethodKind.StaticConstructor), 396CodeAnalysis.MethodKind.AnonymousFunction => nameof(CodeAnalysis.MethodKind.LambdaMethod), 427CodeAnalysis.SymbolKind.Method => new(CodeAnalysis.MethodKind.Ordinary), 436=> new((MethodKind)Enum.Parse(typeof(MethodKind), methodKindElement.Value)); 444public static implicit operator SymbolKindOrTypeKind(MethodKind symbolKind)
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 (2)
76/// cref="IRangeVariableSymbol"/> and <see cref="MethodKind.LocalFunction"/> <see cref="IMethodSymbol"/>s can also 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 (4)
373case MethodKind.AnonymousFunction: 378case MethodKind.BuiltinOperator: 383case MethodKind.ReducedExtension: 388case MethodKind.LocalFunction:
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 (6)
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_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (19)
201MethodKind: MethodKind.Ordinary or 202MethodKind.PropertyGet or 203MethodKind.PropertySet or 204MethodKind.UserDefinedOperator or 205MethodKind.Conversion 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 }; 659=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\MethodKindExtensions.cs (3)
11public static bool IsPropertyAccessor(this MethodKind kind) 12=> kind is MethodKind.PropertyGet or MethodKind.PropertySet;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (3)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction)
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 (11)
184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 249private static bool AreCompatibleMethodKinds(MethodKind kind1, MethodKind kind2) 256if ((kind1 == MethodKind.Ordinary && kind2.IsPropertyAccessor()) || 257(kind1.IsPropertyAccessor() && kind2 == MethodKind.Ordinary)) 263if ((kind1 == MethodKind.BuiltinOperator && kind2 == MethodKind.UserDefinedOperator) || 264(kind1 == MethodKind.UserDefinedOperator && kind2 == MethodKind.BuiltinOperator))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
Microsoft.CodeAnalysis.CodeStyle (97)
src\9547feb31df4cc5d\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
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 (3)
929/// 4. If method, then it is a constructor OR a method with <see cref="MethodKind.Ordinary"/>, 951case MethodKind.Constructor: 981case MethodKind.Ordinary:
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 (3)
325case MethodKind.AnonymousFunction: 326case MethodKind.DelegateInvoke: 338case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
78private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 79private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 283case MethodKind.Ordinary: 286case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
46return method.MethodKind is MethodKind.Ordinary or 47MethodKind.LocalFunction;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (19)
70new SymbolKindOrTypeKind(MethodKind.Ordinary), 71new SymbolKindOrTypeKind(MethodKind.LocalFunction), 169case MethodKind.AnonymousFunction: 170case MethodKind.LocalFunction: 298foreach (var methodKindElement in symbolKindListElement.Elements(nameof(MethodKind))) 349public SymbolKindOrTypeKind(MethodKind methodKind) 356public MethodKind? MethodKind => (_category == SymbolCategory.Method) ? (MethodKind)_kind : null; 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind, 372SymbolCategory.Method => new XElement(nameof(MethodKind), GetMethodKindString((MethodKind)_kind)), 388private static string GetMethodKindString(MethodKind methodKind) 395CodeAnalysis.MethodKind.SharedConstructor => nameof(CodeAnalysis.MethodKind.StaticConstructor), 396CodeAnalysis.MethodKind.AnonymousFunction => nameof(CodeAnalysis.MethodKind.LambdaMethod), 427CodeAnalysis.SymbolKind.Method => new(CodeAnalysis.MethodKind.Ordinary), 436=> new((MethodKind)Enum.Parse(typeof(MethodKind), methodKindElement.Value)); 444public static implicit operator SymbolKindOrTypeKind(MethodKind symbolKind)
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 (2)
76/// cref="IRangeVariableSymbol"/> and <see cref="MethodKind.LocalFunction"/> <see cref="IMethodSymbol"/>s can also 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 (4)
373case MethodKind.AnonymousFunction: 378case MethodKind.BuiltinOperator: 383case MethodKind.ReducedExtension: 388case MethodKind.LocalFunction:
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 (6)
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_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (19)
201MethodKind: MethodKind.Ordinary or 202MethodKind.PropertyGet or 203MethodKind.PropertySet or 204MethodKind.UserDefinedOperator or 205MethodKind.Conversion 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 }; 659=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\MethodKindExtensions.cs (3)
11public static bool IsPropertyAccessor(this MethodKind kind) 12=> kind is MethodKind.PropertyGet or MethodKind.PropertySet;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (3)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction)
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 (11)
184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 249private static bool AreCompatibleMethodKinds(MethodKind kind1, MethodKind kind2) 256if ((kind1 == MethodKind.Ordinary && kind2.IsPropertyAccessor()) || 257(kind1.IsPropertyAccessor() && kind2 == MethodKind.Ordinary)) 263if ((kind1 == MethodKind.BuiltinOperator && kind2 == MethodKind.UserDefinedOperator) || 264(kind1 == MethodKind.UserDefinedOperator && kind2 == MethodKind.BuiltinOperator))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
Microsoft.CodeAnalysis.CodeStyle.Fixes (36)
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\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (2)
59MethodKind = MethodKind.Conversion; 83MethodKind = MethodKind.Conversion;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (1)
54MethodKind = MethodKind.Ordinary;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (2)
85MethodKind = MethodKind.Ordinary; 124MethodKind = MethodKind.Ordinary;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
41public MethodKind MethodKind { get; internal set; }
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
364return method1.MethodKind == MethodKind.Ordinary && 365method2.MethodKind == MethodKind.Ordinary &&
src\roslyn\src\Analyzers\Core\CodeFixes\Naming\FallbackNamingRules.cs (3)
59var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary)); 78var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary)); 88var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (4)
161MethodKind methodKind = MethodKind.Ordinary, 182MethodKind methodKind = MethodKind.Ordinary,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
72public virtual MethodKind MethodKind => MethodKind.Ordinary;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (2)
27public override MethodKind MethodKind => MethodKind.Constructor;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (2)
34public override MethodKind MethodKind => MethodKind.Conversion;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (2)
23public override MethodKind MethodKind => MethodKind.Destructor;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (5)
20public override MethodKind MethodKind { get; } 35MethodKind methodKind = MethodKind.Ordinary, 42Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet); 43this.IsInitOnly = methodKind == MethodKind.PropertySet && isInitOnly;
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)];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (2)
32public override MethodKind MethodKind => MethodKind.UserDefinedOperator;
Microsoft.CodeAnalysis.CSharp (641)
Binder\Binder_Await.cs (1)
179if (method.MethodKind == MethodKind.AnonymousFunction)
Binder\Binder_Conversions.cs (6)
2747Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 2749Debug.Assert(TypeSymbol.Equals(destination.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions)); 2766if (analysis.Operator.MethodKind == MethodKind.Constructor) 3364Debug.Assert(memberSymbol is not MethodSymbol { MethodKind: not MethodKind.Constructor } || 3369if (receiverOpt != null || memberSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor })
Binder\Binder_Crefs.cs (4)
281methodKind: MethodKind.Ordinary, 312methodKind: MethodKind.Ordinary, 983MethodKind candidateMethodKind = candidateMethod.MethodKind; 987int signatureMemberArity = candidateMethodKind == MethodKind.Constructor
Binder\Binder_Expressions.cs (11)
1570ContainingMember() is MethodSymbol { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: PropertySymbol { IsIndexer: false } }) 2052return (containingMethod.MethodKind == MethodKind.AnonymousFunction || containingMethod.MethodKind == MethodKind.LocalFunction) && !IsInsideNameof; // false in EE evaluation method 2090(this.ContainingMember() is MethodSymbol { MethodKind: MethodKind.Constructor } containingMember && (object)containingMember != primaryCtor)) && // We are in a non-primary instance constructor 2163this.ContainingMemberOrLambda is MethodSymbol { MethodKind: MethodKind.AnonymousFunction or MethodKind.LocalFunction } && 4927Debug.Assert(constructor.MethodKind == MethodKind.Constructor || 4928constructor.MethodKind == MethodKind.StaticConstructor); // error scenario: constructor initializer on static constructor 6796Debug.Assert(constructor.MethodKind == MethodKind.Constructor || constructor.MethodKind == MethodKind.StaticConstructor);
Binder\Binder_Invocation.cs (2)
864if (result is null && finalApplicableCandidates[0].LeastOverriddenMember.MethodKind != MethodKind.LocalFunction) 953if (singleCandidate.MethodKind != MethodKind.LocalFunction)
Binder\Binder_Lookup.cs (1)
1504else if ((options & LookupOptions.MustBeOperator) != 0 && unwrappedSymbol is not MethodSymbol { MethodKind: MethodKind.UserDefinedOperator })
Binder\Binder_Statements.cs (3)
1841MethodKind.StaticConstructor : 1842MethodKind.Constructor) || 3911if (constructor.MethodKind != MethodKind.Constructor || constructor.IsExtern)
Binder\Binder.cs (1)
793return symbol.IsExtensionBlockMember() && (symbol.IsStatic || symbol.MethodKind != MethodKind.Ordinary);
Binder\Binder.ValueChecks.cs (7)
1728MethodKind desiredMethodKind = fieldIsStatic ? MethodKind.StaticConstructor : MethodKind.Constructor; 2201if (method.MethodKind == MethodKind.Constructor || method.IsInitOnly) 2850if (method.MethodKind == MethodKind.Constructor) 5740MethodKind.Ordinary, 5780MethodKind.Ordinary,
Binder\InMethodBinder.cs (3)
88internal override bool IsNestedFunctionBinder => _methodSymbol.MethodKind == MethodKind.LocalFunction; 263if (((MethodSymbol)newSymbol).MethodKind == MethodKind.LocalFunction) 299if (((MethodSymbol)newSymbol).MethodKind == MethodKind.LocalFunction)
Binder\LocalBinderFactory.cs (1)
310SourcePropertyAccessorSymbol { MethodKind: MethodKind.PropertySet } setter => getSetterParameters(setter),
Binder\LockBinder.cs (1)
126MethodKind: MethodKind.Ordinary,
Binder\MethodGroupResolution.cs (1)
104MethodGroup.Methods[0].MethodKind == MethodKind.LocalFunction;
Binder\Semantics\AccessCheck.cs (1)
196case SymbolKind.Method when ((MethodSymbol)symbol).MethodKind == MethodKind.LocalFunction:
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
4594Debug.Assert(candidate is MethodSymbol { MethodKind: MethodKind.UserDefinedOperator });
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
535Debug.Assert(firstSupported.Member is MethodSymbol { MethodKind: MethodKind.Constructor });
BoundTree\BoundBinaryOperator.UncommonData.cs (1)
74Debug.Assert(method is null or ErrorMethodSymbol { ParameterCount: 0 } or { MethodKind: MethodKind.UserDefinedOperator } or { ParameterCount: 2 });
BoundTree\BoundExpressionExtensions.cs (1)
145if (expr is BoundMethodGroup { Methods: not [{ MethodKind: MethodKind.LocalFunction }] } &&
BoundTree\BoundNodeExtensions.cs (1)
62return method.MethodKind == MethodKind.Constructor &&
CodeGen\CodeGenerator_HasHome.cs (2)
256return containingSymbol is MethodSymbol { MethodKind: MethodKind.StaticConstructor } or FieldSymbol { IsStatic: true }; 260return (containingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor } or FieldSymbol { IsStatic: false } or MethodSymbol { IsInitOnly: true }) &&
CodeGen\EmitExpression.cs (1)
2238if (method.IsEffectivelyReadOnly && method.MethodKind != MethodKind.Constructor)
Compilation\CSharpCompilation.cs (1)
3188if (symbol.Kind == SymbolKind.Method && symbol.IsImplicitlyDeclared && ((MethodSymbol)symbol).MethodKind == MethodKind.Constructor)
Compilation\CSharpSemanticModel.cs (2)
1811case MethodSymbol { MethodKind: MethodKind.LambdaMethod }: 4806if (call.InvokedAsExtensionMethod && method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension)
Compilation\MemberSemanticModel.cs (1)
2393Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod });
Compilation\MethodBodySemanticModel.cs (1)
240if (MemberSymbol is MethodSymbol methodSymbol && methodSymbol.MethodKind == MethodKind.Constructor &&
Compilation\SyntaxTreeSemanticModel.cs (1)
2452Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod });
Compiler\ClsComplianceChecker.cs (1)
736if (method.MethodKind == MethodKind.DelegateInvoke)
Compiler\MethodBodySynthesizer.cs (5)
178Debug.Assert(accessor.MethodKind == MethodKind.PropertyGet || accessor.MethodKind == MethodKind.PropertySet); 193if (accessor.MethodKind == MethodKind.PropertyGet) 199Debug.Assert(accessor.MethodKind == MethodKind.PropertySet); 534Debug.Assert(method.MethodKind == MethodKind.Destructor);
Compiler\MethodCompiler.cs (5)
548(method.MethodKind == MethodKind.Constructor || method.IsScriptInitializer) ? processedInstanceInitializers : 549method.MethodKind == MethodKind.StaticConstructor ? processedStaticInitializers : 1915if (method.MethodKind == MethodKind.StaticConstructor && 2091if (method.MethodKind == MethodKind.Destructor && body != null) 2500if (method.MethodKind == MethodKind.Constructor && !method.IsExtern)
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (1)
115if (symbol.MethodKind == MethodKind.Conversion)
Emitter\Model\MethodSymbolAdapter.cs (5)
408return AdaptedMethodSymbol.MethodKind == MethodKind.Constructor; 661return this.MethodKind == MethodKind.Constructor 662|| this.MethodKind == MethodKind.StaticConstructor; 671Debug.Assert(this.MethodKind != MethodKind.Destructor); 675!(this.IsVirtual || this.IsOverride || this.IsAbstract || this.MethodKind == MethodKind.Destructor));
Emitter\Model\NamedTypeSymbolAdapter.cs (3)
361else if (method.MethodKind == MethodKind.Destructor && AdaptedNamedTypeSymbol.SpecialType != SpecialType.System_Object) 372if ((object)objectMethod != null && objectMethod.MethodKind == MethodKind.Destructor) 634if ((alwaysIncludeConstructors && method.MethodKind == MethodKind.Constructor) || method.GetCciAdapter().ShouldInclude(context))
Emitter\Model\PropertySymbolAdapter.cs (3)
78return GetSynthesizedSealedAccessor(MethodKind.PropertyGet); 133return GetSynthesizedSealedAccessor(MethodKind.PropertySet); 291private IMethodReference GetSynthesizedSealedAccessor(MethodKind targetMethodKind)
Emitter\Model\SynthesizedPrivateImplementationDetailsStaticConstructor.cs (2)
24public override MethodKind MethodKind => MethodKind.StaticConstructor;
Emitter\NoPia\EmbeddedMethod.cs (1)
71return UnderlyingMethod.AdaptedMethodSymbol.MethodKind == MethodKind.Constructor;
FlowAnalysis\AbstractFlowPass.cs (2)
1422if (method is null || method.MethodKind != MethodKind.Constructor) 1519Debug.Assert(method?.OriginalDefinition.MethodKind != MethodKind.LocalFunction);
FlowAnalysis\DefiniteAssignment.cs (6)
103&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1211Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1264if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 2328(currentMethod.MethodKind == MethodKind.AnonymousFunction || 2329currentMethod.MethodKind == MethodKind.LocalFunction) && 2403if (method.MethodKind == MethodKind.LocalFunction)
FlowAnalysis\DefiniteAssignment.LocalFunctions.cs (1)
163((MethodSymbol)symbol).MethodKind == MethodKind.LocalFunction)
FlowAnalysis\DefiniteAssignment.VariableIdentifier.cs (1)
36SymbolKind.Method when symbol is MethodSymbol m && m.MethodKind == MethodKind.LocalFunction => true,
FlowAnalysis\FlowAnalysisPass.cs (2)
76Debug.Assert(method.MethodKind != MethodKind.AnonymousFunction); 116Debug.Assert(method.MethodKind == MethodKind.Constructor);
FlowAnalysis\NullableWalker.cs (11)
516Debug.Assert(baseOrThisInitializer is null or { MethodKind: MethodKind.Constructor }); 1628return constructorBody is BoundConstructorMethodBody { Initializer: BoundExpressionStatement { Expression: BoundCall { Method: { MethodKind: MethodKind.Constructor } initializerMethod } } } 1912Debug.Assert(getterNullResilienceData is null || symbol is SourcePropertyAccessorSymbol { MethodKind: MethodKind.PropertyGet }); 2326while (enclosingMemberMethod?.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 7183|| method.MethodKind != MethodKind.Ordinary 9230if (((MethodSymbol)symbol).MethodKind == MethodKind.LocalFunction) 10688Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 10690Debug.Assert(TypeSymbol.Equals(targetTypeWithNullability.Type.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions)); 10771Debug.Assert(factory.MethodKind == MethodKind.Constructor);
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (2)
460if (node.Method.MethodKind == MethodKind.LocalFunction) 471if (node.MethodOpt?.MethodKind == MethodKind.LocalFunction)
Lowering\ClosureConversion\ClosureConversion.cs (11)
194_seenBaseCall = method.MethodKind != MethodKind.Constructor; // only used for ctors 208(localOrParameter as MethodSymbol)?.MethodKind == MethodKind.LocalFunction); 450originalMethod.MethodKind == MethodKind.LambdaMethod && 804if (_currentMethod.MethodKind == MethodKind.Constructor && 873var loweredSymbol = (node.Method.MethodKind is MethodKind.LambdaMethod or MethodKind.LocalFunction) ? 891Debug.Assert(localFunc.MethodKind == MethodKind.LocalFunction); 1086if (node.Method.MethodKind == MethodKind.LocalFunction) 1351if (node.MethodOpt?.MethodKind == MethodKind.LocalFunction) 1377if (node.TargetMethod.MethodKind == MethodKind.LocalFunction) 1687_currentMethod.MethodKind != MethodKind.StaticConstructor &&
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (2)
39originalMethod is { MethodKind: MethodKind.LocalFunction } 108Debug.Assert(originalMethod is not { MethodKind: MethodKind.LocalFunction } || !originalMethod.IsStatic || IsStatic);
Lowering\DiagnosticsPass_ExpressionTrees.cs (4)
197var diagnostic = _staticLocalOrAnonymousFunction.MethodKind == MethodKind.LocalFunction 212var diagnostic = _staticLocalOrAnonymousFunction.MethodKind == MethodKind.LocalFunction 354else if (method.MethodKind == MethodKind.LocalFunction) 955if ((node.LookupSymbolOpt as MethodSymbol)?.MethodKind == MethodKind.LocalFunction)
Lowering\DiagnosticsPass_Warnings.cs (1)
367if ((object)op == null || op.MethodKind != MethodKind.UserDefinedOperator) continue;
Lowering\ExtensionMethodBodyRewriter.cs (2)
153case MethodKind.LambdaMethod: 156case MethodKind.LocalFunction:
Lowering\ExtensionMethodReferenceRewriter.cs (1)
77Debug.Assert(node.Method.MethodKind == MethodKind.LocalFunction || node.Method.IsStatic || node.ReceiverOpt is not null);
Lowering\InitializerRewriter.cs (2)
22Debug.Assert((method.MethodKind == MethodKind.Constructor) || (method.MethodKind == MethodKind.StaticConstructor));
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
143Debug.Assert(method.MethodKind != MethodKind.LocalFunction && method.MethodKind != MethodKind.AnonymousFunction);
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (5)
50if (method.MethodKind is not (MethodKind.Constructor or MethodKind.StaticConstructor) && 84if (isMethodBody && _factory.TopLevelMethod.MethodKind == MethodKind.StaticConstructor) 156if (method.MethodKind is not (MethodKind.Ordinary or MethodKind.Constructor))
Lowering\Instrumentation\StackOverflowProbingInstrumenter.cs (3)
40if (method.MethodKind is not (MethodKind.Constructor or MethodKind.StaticConstructor) && 74if (isMethodBody && _factory.TopLevelMethod.MethodKind == MethodKind.StaticConstructor)
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (2)
70public override MethodKind MethodKind 72get { return MethodKind.Ordinary; }
Lowering\LocalRewriter\DelegateCacheRewriter.cs (2)
128if (targetMethod.MethodKind == MethodKind.LocalFunction) 167Debug.Assert(targetMethod.MethodKind == MethodKind.Ordinary);
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
194if (method.MethodKind is not MethodKind.Ordinary) 680var requiresInstanceReceiver = methodOrIndexer.RequiresInstanceReceiver() && methodOrIndexer is not MethodSymbol { MethodKind: MethodKind.Constructor } and not FunctionPointerMethodSymbol;
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
1105if (asSpanMethod is MethodSymbol { MethodKind: MethodKind.Constructor } constructor)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (7)
588&& _factory.TopLevelMethod.MethodKind != MethodKind.StaticConstructor // Avoid caching twice if people do it manually. 962Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 964Debug.Assert(TypeSymbol.Equals(rewrittenType.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions)); 1560Debug.Assert(conversion.Method is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 1567if (factory is { MethodKind: MethodKind.Constructor } constructor)
Lowering\LocalRewriter\LocalRewriter_Literal.cs (1)
72if ((curMethod.MethodKind != MethodKind.SharedConstructor ||
Lowering\LocalRewriter\LocalRewriter_Range.cs (3)
167case MethodKind.Constructor: 177case MethodKind.Ordinary: 189case MethodKind.PropertyGet:
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (3)
155node.Method.MethodKind == MethodKind.LocalFunction || 216if (conversion.Method.MethodKind == MethodKind.LocalFunction) 240node.MethodOpt?.MethodKind == MethodKind.LocalFunction;
Lowering\SynthesizedMethodBaseSymbol.cs (1)
42methodKind: MethodKind.Ordinary,
Lowering\SyntheticBoundNodeFactory.cs (4)
77value.MethodKind != MethodKind.AnonymousFunction && 78value.MethodKind != MethodKind.LocalFunction) 146CurrentFunction.MethodKind == MethodKind.AnonymousFunction || 147CurrentFunction.MethodKind == MethodKind.LocalFunction ||
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
107Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
SymbolDisplay\SymbolDisplayVisitor.cs (1)
388return ((IMethodSymbol)symbol).MethodKind == MethodKind.LocalFunction;
SymbolDisplay\SymbolDisplayVisitor.Members.cs (30)
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) 325case MethodKind.Constructor: 326case MethodKind.StaticConstructor: 328case MethodKind.Destructor: 339case MethodKind.Conversion: 386if (symbol.MethodKind == MethodKind.LocalFunction) 391else if (symbol.MethodKind == MethodKind.ReducedExtension) 423case MethodKind.Ordinary: 424case MethodKind.DelegateInvoke: 425case MethodKind.LocalFunction: 431case MethodKind.ReducedExtension: 438case MethodKind.PropertyGet: 439case MethodKind.PropertySet: 445goto case MethodKind.Ordinary; 449AddKeyword(symbol.MethodKind == MethodKind.PropertyGet ? SyntaxKind.GetKeyword : 453case MethodKind.EventAdd: 454case MethodKind.EventRemove: 460goto case MethodKind.Ordinary; 464AddKeyword(symbol.MethodKind == MethodKind.EventAdd ? SyntaxKind.AddKeyword : SyntaxKind.RemoveKeyword); 467case MethodKind.Constructor: 468case MethodKind.StaticConstructor: 483case MethodKind.Destructor: 499case MethodKind.ExplicitInterfaceImplementation: 529case MethodKind.UserDefinedOperator: 530case MethodKind.BuiltinOperator: 551case MethodKind.Conversion: 783hasThisParameter: symbol.IsExtensionMethod && symbol.MethodKind != MethodKind.ReducedExtension,
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ConstructorSymbol.cs (2)
43public override MethodKind MethodKind 45get { return MethodKind.Constructor; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.EqualsMethodSymbol.cs (2)
28public override MethodKind MethodKind 30get { return MethodKind.Ordinary; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.GetHashCodeMethodSymbol.cs (2)
32public override MethodKind MethodKind 34get { return MethodKind.Ordinary; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertyAccessorSymbol.cs (2)
29public override MethodKind MethodKind 31get { return MethodKind.PropertyGet; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ToStringMethodSymbol.cs (2)
32public override MethodKind MethodKind 34get { return MethodKind.Ordinary; }
Symbols\Compilation_WellKnownMembers.cs (8)
260MethodKind targetMethodKind = MethodKind.Ordinary; 268targetMethodKind = MethodKind.Constructor; 279targetMethodKind = MethodKind.PropertyGet; 312MethodKind methodKind = method.MethodKind; 315if (methodKind == MethodKind.Conversion || methodKind == MethodKind.UserDefinedOperator) 317methodKind = MethodKind.Ordinary;
Symbols\ErrorMethodSymbol.cs (4)
203public override MethodKind MethodKind 210return MethodKind.Constructor; 213return MethodKind.Ordinary; 287Debug.Assert(MethodKind == MethodKind.Constructor);
Symbols\Extensions\SourceExtensionImplementationMethodSymbol.cs (3)
33public override MethodKind MethodKind => MethodKind.Ordinary; 46public sealed override bool IsExtensionMethod => !_originalMethod.IsStatic && _originalMethod.MethodKind is MethodKind.Ordinary;
Symbols\Extensions\SynthesizedExtensionMarker.cs (1)
25MethodKind.Ordinary, RefKind.None, GetDeclarationModifiers(), returnsVoid: false, returnsVoidIsSet: false,
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (2)
772public override MethodKind MethodKind => MethodKind.FunctionPointerSignature;
Symbols\MemberSymbolExtensions.cs (7)
419return methodSymbol.MethodKind == MethodKind.UserDefinedOperator || methodSymbol.MethodKind == MethodKind.Conversion; 439return symbol.Kind == SymbolKind.Method && ((MethodSymbol)symbol).MethodKind == MethodKind.Conversion; 608case MethodKind.Constructor: 609case MethodKind.StaticConstructor: 621if ((object)method != null && method.MethodKind == MethodKind.Constructor) 686return method.MethodKind == MethodKind.Constructor && method.ParameterCount == 0;
Symbols\Metadata\PE\PEEventSymbol.cs (2)
128_addMethod.SetAssociatedEvent(this, MethodKind.EventAdd); 129_removeMethod.SetAssociatedEvent(this, MethodKind.EventRemove);
Symbols\Metadata\PE\PEMethodSymbol.cs (41)
120public MethodKind MethodKind 124return (MethodKind)((_bits >> MethodKindOffset) & MethodKindMask); 189public void InitializeMethodKind(MethodKind methodKind) 652private bool IsDestructor => this.MethodKind == MethodKind.Destructor; 815internal bool SetAssociatedProperty(PEPropertySymbol propertySymbol, MethodKind methodKind) 817Debug.Assert((methodKind == MethodKind.PropertyGet) || (methodKind == MethodKind.PropertySet)); 825internal bool SetAssociatedEvent(PEEventSymbol eventSymbol, MethodKind methodKind) 827Debug.Assert((methodKind == MethodKind.EventAdd) || (methodKind == MethodKind.EventRemove)); 831private bool SetAssociatedPropertyOrEvent(Symbol propertyOrEventSymbol, MethodKind methodKind) 844_packedFlags.MethodKind == default(MethodKind) || 845_packedFlags.MethodKind == MethodKind.Ordinary || 846_packedFlags.MethodKind == MethodKind.ExplicitInterfaceImplementation); 1006if (this.MethodKind == MethodKind.Ordinary && IsValidExtensionMethodSignature() 1070bool isClosedConstructor = MethodKind == MethodKind.Constructor && ContainingType.IsClosed; 1133public override MethodKind MethodKind 1217private MethodKind ComputeMethodKind() 1241return MethodKind.StaticConstructor; 1246return MethodKind.Constructor; 1250return MethodKind.Ordinary; 1280return IsValidStaticUserDefinedOperatorSignature(2) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary; 1292return IsValidStaticUserDefinedOperatorSignature(1) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary; 1296return IsValidStaticUserDefinedOperatorSignature(1) ? MethodKind.Conversion : MethodKind.Ordinary; 1314return IsValidInstanceUserDefinedOperatorSignature(0) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary; 1331return IsValidInstanceUserDefinedOperatorSignature(1) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary; 1335return MethodKind.Ordinary; 1347return MethodKind.Destructor; 1353return MethodKind.DelegateInvoke; 1364return MethodKind.ExplicitInterfaceImplementation; 1367return MethodKind.Ordinary; 1401method.MethodKind == MethodKind.Destructor); 1507this.MethodKind == MethodKind.PropertySet && 1576if (MethodKind == MethodKind.Constructor) 1674Debug.Assert(MethodKind == MethodKind.Constructor); 1696var result = ObsoleteAttributeHelpers.GetObsoleteDataFromMetadata(_handle, (PEModuleSymbol)ContainingModule, ignoreByRefLikeMarker: false, ignoreRequiredMemberMarker: MethodKind == MethodKind.Constructor);
Symbols\Metadata\PE\PEParameterSymbol.cs (2)
908|| ContainingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.DelegateInvoke }
Symbols\Metadata\PE\PEPropertySymbol.cs (2)
349_getMethod.SetAssociatedProperty(this, MethodKind.PropertyGet); 354_setMethod.SetAssociatedProperty(this, MethodKind.PropertySet);
Symbols\MethodSymbol.cs (31)
66public abstract MethodKind MethodKind 382protected bool IsValidReadOnlyTarget => !IsStatic && ContainingType.IsStructType() && MethodKind != MethodKind.Constructor && !IsInitOnly; 602internal bool HasSetsRequiredMembers => MethodKind == MethodKind.Constructor && HasSetsRequiredMembersImpl; 613internal static bool CanOverrideOrHide(MethodKind kind) 617case MethodKind.AnonymousFunction: 618case MethodKind.Constructor: 619case MethodKind.Destructor: 620case MethodKind.ExplicitInterfaceImplementation: 621case MethodKind.StaticConstructor: 622case MethodKind.ReducedExtension: 624case MethodKind.Conversion: 625case MethodKind.DelegateInvoke: 626case MethodKind.EventAdd: 627case MethodKind.EventRemove: 628case MethodKind.LocalFunction: 629case MethodKind.UserDefinedOperator: 630case MethodKind.Ordinary: 631case MethodKind.PropertyGet: 632case MethodKind.PropertySet: 668return MethodKind == MethodKind.Constructor && ContainingType.IsScriptClass; 684return ((MethodKind == MethodKind.Constructor || MethodKind == MethodKind.StaticConstructor) && IsImplicitlyDeclared); 695return MethodKind == MethodKind.Constructor && IsImplicitlyDeclared; 773if (!this.IsExtensionMethod || this.MethodKind == MethodKind.ReducedExtension || receiverType.IsVoidType()) 789return (this.IsExtensionMethod && this.MethodKind != MethodKind.ReducedExtension) ? ReducedExtensionMethodSymbol.Create(this) : null; 1057if (!IsStatic || IsAbstract || IsVirtual || MethodKind is not (MethodKind.Ordinary or MethodKind.LocalFunction)) 1217MethodKind is MethodKind.Ordinary 1218or MethodKind.Constructor 1219or MethodKind.UserDefinedOperator 1220or MethodKind.ReducedExtension
Symbols\MethodSymbolExtensions.cs (18)
24return method.IsImplicitlyDeclared && method.MethodKind == MethodKind.AnonymousFunction; 53if (!skipFirstMethodKindCheck && method.MethodKind == MethodKind.Destructor) 100if (hiddenMethod.MethodKind == MethodKind.Destructor) 129case MethodKind.Destructor: 130case MethodKind.Constructor: 131case MethodKind.StaticConstructor: 132case MethodKind.Conversion: 134case MethodKind.UserDefinedOperator: 135return !method.IsStatic && hidingMember is MethodSymbol { IsStatic: false, MethodKind: MethodKind.UserDefinedOperator }; 137case MethodKind.EventAdd: 138case MethodKind.EventRemove: 139case MethodKind.PropertyGet: 140case MethodKind.PropertySet: 223method.MethodKind is (MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet or MethodKind.UserDefinedOperator) &&
Symbols\NamedTypeSymbol.cs (12)
266if (candidate is MethodSymbol { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } method) 277if (candidate is MethodSymbol { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } method) 338Debug.Assert(method.MethodKind == MethodKind.Constructor); 346Debug.Assert(method.MethodKind == MethodKind.StaticConstructor); 418Debug.Assert(method.MethodKind != MethodKind.ReducedExtension); 531if ((options & LookupOptions.MustBeOperator) != 0 && member is not MethodSymbol { MethodKind: MethodKind.UserDefinedOperator }) 2070if (definitionFactoryMethods[0].MethodKind != MethodKind.Constructor) 2118Debug.Assert(definitionFactoryMethod.MethodKind == MethodKind.Constructor); 2194MethodKind: MethodKind.Ordinary, 2397Debug.Assert(ctor.MethodKind is MethodKind.Constructor);
Symbols\NativeIntegerTypeSymbol.cs (2)
102case MethodKind.Ordinary: 119case MethodKind.Constructor:
Symbols\OverriddenOrHiddenMembersHelpers.cs (2)
246bool accessorIsGetter = accessor.MethodKind == MethodKind.PropertyGet; 338bool accessorIsAdder = accessor.MethodKind == MethodKind.EventAdd;
Symbols\PublicModel\MethodSymbol.cs (35)
34MethodKind IMethodSymbol.MethodKind 40case MethodKind.AnonymousFunction: 41return MethodKind.AnonymousFunction; 42case MethodKind.Constructor: 43return MethodKind.Constructor; 44case MethodKind.Conversion: 45return MethodKind.Conversion; 46case MethodKind.DelegateInvoke: 47return MethodKind.DelegateInvoke; 48case MethodKind.Destructor: 49return MethodKind.Destructor; 50case MethodKind.EventAdd: 51return MethodKind.EventAdd; 52case MethodKind.EventRemove: 53return MethodKind.EventRemove; 54case MethodKind.ExplicitInterfaceImplementation: 55return MethodKind.ExplicitInterfaceImplementation; 56case MethodKind.UserDefinedOperator: 57return MethodKind.UserDefinedOperator; 58case MethodKind.BuiltinOperator: 59return MethodKind.BuiltinOperator; 60case MethodKind.Ordinary: 61return MethodKind.Ordinary; 62case MethodKind.PropertyGet: 63return MethodKind.PropertyGet; 64case MethodKind.PropertySet: 65return MethodKind.PropertySet; 66case MethodKind.ReducedExtension: 67return MethodKind.ReducedExtension; 68case MethodKind.StaticConstructor: 69return MethodKind.StaticConstructor; 70case MethodKind.LocalFunction: 71return MethodKind.LocalFunction; 72case MethodKind.FunctionPointerSignature: 73return MethodKind.FunctionPointerSignature;
Symbols\ReducedExtensionMethodSymbol.cs (5)
40Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 75Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 117Debug.Assert(method.MethodKind != MethodKind.ReducedExtension); 470public override MethodKind MethodKind 472get { return MethodKind.ReducedExtension; }
Symbols\SignatureOnlyMethodSymbol.cs (3)
23private readonly MethodKind _methodKind; 37MethodKind methodKind, 93public override MethodKind MethodKind { get { return _methodKind; } }
Symbols\Source\ExplicitInterfaceHelpers.cs (3)
101if (method.MethodKind != MethodKind.ExplicitInterfaceImplementation) 270(interfaceMethod.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion) != isOperator)
Symbols\Source\LambdaSymbol.cs (2)
80public override MethodKind MethodKind 82get { return MethodKind.AnonymousFunction; }
Symbols\Source\LocalFunctionSymbol.cs (2)
360public override MethodKind MethodKind => MethodKind.LocalFunction;
Symbols\Source\ParameterHelpers.cs (3)
227Debug.Assert(methodOwner?.MethodKind != MethodKind.LambdaMethod); 229methodOwner?.MethodKind == MethodKind.LocalFunction; 1124if (method.MethodKind != MethodKind.AnonymousFunction)
Symbols\Source\SourceComplexParameterSymbol.cs (3)
1389|| ContainingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.DelegateInvoke or MethodKind.LambdaMethod }
Symbols\Source\SourceConstructorSymbol.cs (14)
26var methodKind = syntax.Modifiers.Any(SyntaxKind.StaticKeyword) ? MethodKind.StaticConstructor : MethodKind.Constructor; 34MethodKind methodKind, 66if (methodKind == MethodKind.Constructor && syntax.Initializer != null) 82if (methodKind == MethodKind.StaticConstructor) 101MethodKind methodKind, 142NamedTypeSymbol containingType, ConstructorDeclarationSyntax syntax, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics, 145var defaultAccess = (methodKind == MethodKind.StaticConstructor) ? DeclarationModifiers.None : DeclarationModifiers.Private; 155if (methodKind == MethodKind.Constructor) 164if (methodKind == MethodKind.StaticConstructor) 197private void CheckModifiers(MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics) 207else if (ContainingType.IsStatic && methodKind == MethodKind.Constructor) 257internal sealed override bool CanBeCallerUnsafe => MethodKind != MethodKind.StaticConstructor;
Symbols\Source\SourceConstructorSymbolBase.cs (1)
65if (MethodKind == MethodKind.StaticConstructor && (_lazyParameters.Length != 0) &&
Symbols\Source\SourceDelegateMethodSymbol.cs (5)
28MethodKind methodKind, 223: base(delegateType, voidType, syntax, MethodKind.Constructor, RefKind.None, DeclarationModifiers.Public) 270: base(delegateType, returnType, syntax, MethodKind.DelegateInvoke, refKind, DeclarationModifiers.Virtual | DeclarationModifiers.Public) 363: base((SourceNamedTypeSymbol)invoke.ContainingType, iAsyncResultType, syntax, MethodKind.Ordinary, RefKind.None, DeclarationModifiers.Virtual | DeclarationModifiers.Public) 403: base((SourceNamedTypeSymbol)invoke.ContainingType, invoke.ReturnTypeWithAnnotations, syntax, MethodKind.Ordinary, invoke.RefKind, DeclarationModifiers.Virtual | DeclarationModifiers.Public)
Symbols\Source\SourceDestructorSymbol.cs (1)
69MethodKind.Destructor, RefKind.None, declarationModifiers, returnsVoid: true, returnsVoidIsSet: true,
Symbols\Source\SourceEventAccessorSymbol.cs (6)
36isAdder ? MethodKind.EventAdd : MethodKind.EventRemove, 118if (this.MethodKind == MethodKind.EventAdd) 127Debug.Assert(this.MethodKind == MethodKind.EventRemove); 245? (MethodKind == MethodKind.EventAdd ? other.AddMethod : other.RemoveMethod) 249? (MethodKind == MethodKind.EventAdd ? other.AddMethod : other.RemoveMethod)
Symbols\Source\SourceFieldLikeEventSymbol.cs (1)
269return IsExtern && this.MethodKind == MethodKind.EventAdd
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (2)
568else if (method.MethodKind == MethodKind.Destructor) 907!(overridingMemberIsMethod && ((MethodSymbol)overriddenMember).MethodKind == MethodKind.Destructor)) //destructors are metadata virtual
Symbols\Source\SourceMemberContainerSymbol.cs (48)
2298if (symbol is MethodSymbol { MethodKind: MethodKind.Conversion } conversion) 2375if (method1.OriginalDefinition is SourceMemberMethodSymbol { MethodKind: MethodKind.Constructor } constructor && 2407var methodKind = method1.MethodKind == MethodKind.Constructor ? MessageID.IDS_SK_CONSTRUCTOR : MessageID.IDS_SK_METHOD; 2420var methodName = (method1.MethodKind == MethodKind.Destructor && method2.MethodKind == MethodKind.Destructor) ? 2870if (member.Kind != SymbolKind.Method || ((MethodSymbol)member).MethodKind != MethodKind.Destructor) 4041if (member is MethodSymbol { IsImplicitlyDeclared: false, MethodKind: not (MethodKind.Constructor or MethodKind.StaticConstructor or MethodKind.Destructor or MethodKind.ExplicitInterfaceImplementation) } method && 4581if ((methodSymbol.MethodKind == MethodKind.Ordinary) && 4620if ((methodSymbol.MethodKind == MethodKind.Ordinary) && 4775case MethodKind.Constructor: 4778case MethodKind.Conversion: 4780case MethodKind.UserDefinedOperator: 4782case MethodKind.Destructor: 4785case MethodKind.ExplicitInterfaceImplementation: 4787case MethodKind.Ordinary: 4788case MethodKind.LocalFunction: 4789case MethodKind.PropertyGet: 4790case MethodKind.PropertySet: 4791case MethodKind.EventAdd: 4792case MethodKind.EventRemove: 4793case MethodKind.StaticConstructor: 4845case MethodKind.Constructor: 4846case MethodKind.Conversion: 4847case MethodKind.Destructor: 4848case MethodKind.EventAdd: 4849case MethodKind.EventRemove: 4850case MethodKind.StaticConstructor: 4851case MethodKind.ExplicitInterfaceImplementation: 4853case MethodKind.Ordinary: 4854case MethodKind.UserDefinedOperator: 4855case MethodKind.PropertyGet: 4856case MethodKind.PropertySet: 4893if (m.MethodKind == MethodKind.Constructor && m.ParameterCount == 0) 4935if (hasInitializers && !builder.NonTypeMembersWithPartialImplementations.Any(member => member is MethodSymbol { MethodKind: MethodKind.Constructor })) 5080case MethodSymbol { MethodKind: not (MethodKind.Ordinary or MethodKind.Constructor) }: 5175MethodKind.Ordinary, 5222MethodKind.Constructor, 5275MethodKind.Ordinary, 5335MethodKind.Ordinary, 5509MethodKind.Ordinary, 5602MethodKind.Ordinary, 5694case MethodKind.Constructor: 5704case MethodKind.StaticConstructor: 6314if (member is MethodSymbol { MethodKind: MethodKind.Ordinary })
Symbols\Source\SourceMemberMethodSymbol.cs (12)
126public MethodKind MethodKind 128get { return (MethodKind)((_flags >> MethodKindOffset) & MethodKindMask); } 188MethodKind methodKind, 234MethodKind methodKind, 352if (this.DeclaredAccessibility <= Accessibility.Private || MethodKind == MethodKind.ExplicitInterfaceImplementation) 357ErrorCode code = (this.MethodKind == MethodKind.Conversion || this.MethodKind == MethodKind.UserDefinedOperator) ? 368code = (this.MethodKind == MethodKind.Conversion || this.MethodKind == MethodKind.UserDefinedOperator) ? 422MethodKind methodKind, 554public sealed override MethodKind MethodKind 1080if ((!IsStatic || MethodKind is MethodKind.StaticConstructor) &&
Symbols\Source\SourceMethodSymbol.cs (1)
302if (target.MethodKind == MethodKind.UserDefinedOperator && !target.IsStatic)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (24)
155case MethodKind.Constructor: 156case MethodKind.Destructor: 157case MethodKind.StaticConstructor: 160case MethodKind.PropertySet: 161case MethodKind.EventRemove: 162case MethodKind.EventAdd: 750else if (!this.CanBeReferencedByName || this.MethodKind == MethodKind.Destructor) 765else if (this is { MethodKind: MethodKind.LocalFunction, IsStatic: false }) 962if (MethodKind != MethodKind.Ordinary || this.IsExtensionBlockMember()) 1372if (MethodKind != MethodKind.Ordinary) 1491case MethodKind.Constructor: 1492case MethodKind.StaticConstructor: 1519var errorCode = (this.MethodKind == MethodKind.Constructor || this.MethodKind == MethodKind.StaticConstructor) ? 1571if (this.MethodKind != MethodKind.LambdaMethod) 1675case MethodKind.Constructor: 1676case MethodKind.StaticConstructor: 1677case MethodKind.PropertyGet: 1678case MethodKind.PropertySet: 1679case MethodKind.EventAdd: 1680case MethodKind.EventRemove: 1681case MethodKind.UserDefinedOperator: 1682case MethodKind.Conversion: 1757if (this.ContainingType.IsComImport && this.MethodKind == MethodKind.Constructor)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1981&& !GetMembers().All(m => m is not MethodSymbol { MethodKind: MethodKind.Constructor, ObsoleteKind: ObsoleteAttributeKind.None } method
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (4)
61if (MethodKind == MethodKind.ExplicitInterfaceImplementation) 92if (MethodKind != MethodKind.ExplicitInterfaceImplementation) 202return MethodKind == MethodKind.ExplicitInterfaceImplementation; 272if (MethodKind != MethodKind.Ordinary)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (16)
37var methodKind = interfaceSpecifier == null 38? MethodKind.Ordinary 39: MethodKind.ExplicitInterfaceImplementation; 53MethodKind methodKind, 76ModifierUtils.CheckAccessibility(this.DeclarationModifiers, this, isExplicitInterfaceImplementation: methodKind == MethodKind.ExplicitInterfaceImplementation, diagnostics, location); 90NamedTypeSymbol containingType, Location location, MethodDeclarationSyntax syntax, MethodKind methodKind, 106isExplicitInterfaceImplementation: methodKind == MethodKind.ExplicitInterfaceImplementation, 690Debug.Assert(this.MethodKind != MethodKind.UserDefinedOperator, "SourceUserDefinedOperatorSymbolBase overrides this"); 735CheckModifiers(MethodKind == MethodKind.ExplicitInterfaceImplementation, _location, diagnostics); 752private static (DeclarationModifiers mods, bool hasExplicitAccessMod) MakeModifiers(MethodDeclarationSyntax syntax, NamedTypeSymbol containingType, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics) 756bool isExplicitInterfaceImplementation = methodKind == MethodKind.ExplicitInterfaceImplementation; 838private static DeclarationModifiers AddImpliedModifiers(DeclarationModifiers mods, bool containingTypeIsInterface, MethodKind methodKind, bool hasBody) 845methodKind == MethodKind.ExplicitInterfaceImplementation, 848else if (methodKind == MethodKind.ExplicitInterfaceImplementation) 993MethodKind methodKind, 1051MethodKind methodKind,
Symbols\Source\SourcePropertyAccessorSymbol.cs (20)
42var methodKind = isGetMethod ? MethodKind.PropertyGet : MethodKind.PropertySet; 95var methodKind = isGetMethod ? MethodKind.PropertyGet : MethodKind.PropertySet; 148MethodKind.PropertyGet, 182methodKind: MethodKind.PropertyGet, 209MethodKind methodKind, 250bool hasBlockBody, bool hasExpressionBody, SyntaxTokenList modifiers, MethodKind methodKind, bool isNullableAnalysisEnabled, 386if (MethodKind == MethodKind.PropertySet) 408if (this.MethodKind == MethodKind.PropertyGet) 516MethodKind == MethodKind.PropertyGet; 606else if (LocalDeclaredReadOnly && _isAutoPropertyAccessor && MethodKind == MethodKind.PropertySet) 661MethodSymbol implementedAccessor = this.MethodKind == MethodKind.PropertyGet 690Debug.Assert(MethodKind == MethodKind.PropertySet); 724bool isGetMethod = this.MethodKind == MethodKind.PropertyGet; 808bool isGetMethod = this.MethodKind == MethodKind.PropertyGet; 859? (MethodKind == MethodKind.PropertyGet ? other.GetMethod : other.SetMethod) 863? (MethodKind == MethodKind.PropertyGet ? other.GetMethod : other.SetMethod)
Symbols\Source\SourcePropertySymbolBase.cs (4)
349{ MethodKind: MethodKind.PropertyGet, IsInitOnly: false } => SyntaxFacts.GetText(SyntaxKind.GetKeyword), 350{ MethodKind: MethodKind.PropertySet, IsInitOnly: false } => SyntaxFacts.GetText(SyntaxKind.SetKeyword), 351{ MethodKind: MethodKind.PropertySet, IsInitOnly: true } => SyntaxFacts.GetText(SyntaxKind.InitKeyword), 1252Debug.Assert(thisAccessor.MethodKind == MethodKind.PropertySet);
Symbols\Source\SourceUserDefinedConversionSymbol.cs (4)
43var methodKind = interfaceSpecifier == null 44? MethodKind.Conversion 45: MethodKind.ExplicitInterfaceImplementation; 55MethodKind methodKind,
Symbols\Source\SourceUserDefinedOperatorSymbol.cs (4)
49var methodKind = interfaceSpecifier == null 50? MethodKind.UserDefinedOperator 51: MethodKind.ExplicitInterfaceImplementation; 61MethodKind methodKind,
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (5)
26MethodKind methodKind, 49isExplicitInterfaceImplementation: methodKind == MethodKind.ExplicitInterfaceImplementation, 175protected static DeclarationModifiers MakeDeclarationModifiers(bool isCompoundAssignmentOrIncrementAssignment, MethodKind methodKind, SourceMemberContainerTypeSymbol containingType, BaseMethodDeclarationSyntax syntax, Location location, BindingDiagnosticBag diagnostics) 179bool isExplicitInterfaceImplementation = methodKind == MethodKind.ExplicitInterfaceImplementation; 483if (MethodKind == MethodKind.ExplicitInterfaceImplementation)
Symbols\Source\ThisParameterSymbol.cs (1)
162if (_containingMethod?.MethodKind == MethodKind.Constructor)
Symbols\Symbol_Attributes.cs (4)
58case MethodKind.Constructor: 59case MethodKind.StaticConstructor: 678Debug.Assert(!binder.InAttributeArgument || this is MethodSymbol { MethodKind: MethodKind.LambdaMethod or MethodKind.LocalFunction }, "Possible cycle in attribute binding");
Symbols\Symbol.cs (14)
679case MethodKind.Ordinary: 680case MethodKind.LocalFunction: 681case MethodKind.ReducedExtension: 683case MethodKind.Destructor: 688case MethodKind.DelegateInvoke: 690case MethodKind.PropertyGet: 691case MethodKind.PropertySet: 740case MethodKind.Ordinary: 741case MethodKind.LocalFunction: 742case MethodKind.DelegateInvoke: 743case MethodKind.Destructor: // See comment in CanBeReferencedByName. 745case MethodKind.PropertyGet: 746case MethodKind.PropertySet: 1258this is MethodSymbol method && method.MethodKind == MethodKind.FunctionPointerSignature ?
Symbols\SymbolExtensions.cs (5)
151if (method.MethodKind != MethodKind.AnonymousFunction && method.MethodKind != MethodKind.LocalFunction) break; 171if (method.MethodKind == MethodKind.AnonymousFunction || method.MethodKind == MethodKind.LocalFunction) 816=> method is { MethodKind: MethodKind.Constructor, HasSetsRequiredMembers: false };
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
43MethodKind.Constructor,
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (1)
135if (member is MethodSymbol { ContainingType.IsRecord: true, MethodKind: MethodKind.Constructor } method)
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (1)
161MethodKind.PropertyGet,
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (1)
40: base(MethodKind.UserDefinedOperator, explicitInterfaceType: null, name, isCompoundAssignmentOrIncrementAssignment: false,
Symbols\Synthesized\Records\SynthesizedRecordOrdinaryMethod.cs (1)
17MethodKind.Ordinary, RefKind.None, declarationModifiers, returnsVoid: false, returnsVoidIsSet: false,
Symbols\Synthesized\SynthesizedAccessorValueParameterSymbol.cs (1)
133if (accessor.MethodKind == MethodKind.EventAdd)
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (2)
96public override MethodKind MethodKind 98get { return MethodKind.DelegateInvoke; }
Symbols\Synthesized\SynthesizedEmbeddedAttributePropertySymbol.cs (2)
60public override MethodKind MethodKind => MethodKind.PropertyGet;
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
153public override MethodKind MethodKind 155get { return MethodKind.Ordinary; }
Symbols\Synthesized\SynthesizedEventAccessorSymbol.cs (2)
61return this.MethodKind == MethodKind.EventAdd 147BoundBlock body = CSharp.MethodBodySynthesizer.ConstructFieldLikeEventAccessorBody(fieldLikeEvent, isAddMethod: MethodKind == MethodKind.EventAdd, compilationState.Compilation, diagnostics);
Symbols\Synthesized\SynthesizedExplicitImplementationForwardingMethod.cs (2)
38public override MethodKind MethodKind 44MethodKind.ExplicitInterfaceImplementation;
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (2)
248public override MethodKind MethodKind 250get { return MethodKind.Ordinary; }
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
138public override MethodKind MethodKind 142return MethodKind.ExplicitInterfaceImplementation;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (2)
188public sealed override MethodKind MethodKind 190get { return MethodKind.Constructor; }
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (2)
129public override MethodKind MethodKind 131get { return MethodKind.Ordinary; }
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (2)
67public override MethodKind MethodKind 71return MethodKind.BuiltinOperator;
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (1)
133public override MethodKind MethodKind
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
72MethodKind.Ordinary,
Symbols\Synthesized\SynthesizedStaticConstructor.cs (2)
191public override MethodKind MethodKind 195return MethodKind.StaticConstructor;
Symbols\TypeMap.cs (2)
188stopAt?.MethodKind == MethodKind.StaticConstructor || 189stopAt?.MethodKind == MethodKind.Constructor);
Symbols\TypeSymbol.cs (9)
1573case MethodKind.PropertyGet: 1576case MethodKind.PropertySet: 1579case MethodKind.EventAdd: 1582case MethodKind.EventRemove: 1706else if (implicitImplMethod.IsStatic && implicitImplMethod.MethodKind == MethodKind.Ordinary && implicitImplMethod.GetUnmanagedCallersOnlyAttributeData(forceComplete: true) is not null) 2206isOperator = interfaceMethod.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion; 2214(((MethodSymbol)member).MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion) != isOperator.GetValueOrDefault())
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
274public override MethodKind MethodKind
Microsoft.CodeAnalysis.CSharp.CodeStyle (21)
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 (4)
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 (3)
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 (5)
1126if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1390if (oldSymbolInfo is IMethodSymbol { MethodKind: not (MethodKind.LocalFunction or MethodKind.LambdaMethod) } && 1560if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1561rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
214methodKind: MethodKind.Conversion);
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 (2)
2025while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Microsoft.CodeAnalysis.CSharp.Features (48)
ChangeSignature\CSharpChangeSignatureService.cs (1)
428symbolInfo.Symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension },
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (4)
243_ => [new SymbolKindOrTypeKind(SymbolKind.Local), new SymbolKindOrTypeKind(MethodKind.LocalFunction)], 606new SymbolKindOrTypeKind(MethodKind.Ordinary)); 629? [new SymbolKindOrTypeKind(MethodKind.LocalFunction)] : 630[new SymbolKindOrTypeKind(SymbolKind.Local), new SymbolKindOrTypeKind(MethodKind.LocalFunction)];
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (4)
217case MethodKind.Ordinary: 220case MethodKind.UserDefinedOperator: 221case MethodKind.BuiltinOperator: 225case MethodKind.Conversion:
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (13)
936if (symbol is not IMethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor } method) 1979MethodKind.PropertyGet => symbol.AssociatedSymbol is IPropertySymbol { IsIndexer: true } ? CSharpFeaturesResources.indexer_getter : CSharpFeaturesResources.property_getter, 1980MethodKind.PropertySet => symbol.AssociatedSymbol is IPropertySymbol { IsIndexer: true } ? CSharpFeaturesResources.indexer_setter : CSharpFeaturesResources.property_setter, 1981MethodKind.StaticConstructor => FeaturesResources.static_constructor, 1982MethodKind.Destructor => CSharpFeaturesResources.destructor, 1983MethodKind.Conversion => CSharpFeaturesResources.conversion_operator, 1984MethodKind.LocalFunction => FeaturesResources.local_function, 1985MethodKind.LambdaMethod => CSharpFeaturesResources.lambda, 1986MethodKind.Ordinary when symbol.Name == WellKnownMemberNames.TopLevelStatementsEntryPointMethodName => CSharpFeaturesResources.top_level_code, 2545IMethodSymbol { MethodKind: MethodKind.Destructor } 2549IMethodSymbol { MethodKind: MethodKind.Conversion or MethodKind.UserDefinedOperator }
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (4)
106methodKind: this.LocalFunction ? MethodKind.LocalFunction : MethodKind.Ordinary); 1156var localFunctionPreferences = Options.NamingStyle.SymbolSpecifications.Where(symbol => symbol.AppliesTo(new SymbolSpecification.SymbolKindOrTypeKind(MethodKind.LocalFunction), CreateMethodModifiers().Modifiers, null)); 1159var localFunctionKind = new SymbolSpecification.SymbolKindOrTypeKind(MethodKind.LocalFunction);
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 (2)
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 (4)
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 (3)
71method.MethodKind is MethodKind.PropertyGet or MethodKind.Ordinary && 144=> method.MethodKind != MethodKind.Ordinary
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
214methodKind: MethodKind.Conversion);
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
107Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
Microsoft.CodeAnalysis.CSharp.Workspaces (17)
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_Operators.cs (1)
33if (member is not IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } method)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
825if (symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction })
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 (5)
1126if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1390if (oldSymbolInfo is IMethodSymbol { MethodKind: not (MethodKind.LocalFunction or MethodKind.LambdaMethod) } && 1560if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1561rewrittenMemberSymbol 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 (2)
2025while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Microsoft.CodeAnalysis.Extensions.Package (49)
Symbols\IMethodSymbolExtensions.cs (1)
79if (symbol.MethodKind == MethodKind.BuiltinOperator)
Symbols\INamedTypeSymbolExtensions.cs (6)
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_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
Symbols\ISymbolExtensions.cs (19)
201MethodKind: MethodKind.Ordinary or 202MethodKind.PropertyGet or 203MethodKind.PropertySet or 204MethodKind.UserDefinedOperator or 205MethodKind.Conversion 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 }; 659=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
Symbols\MethodKindExtensions.cs (3)
11public static bool IsPropertyAccessor(this MethodKind kind) 12=> kind is MethodKind.PropertyGet or MethodKind.PropertySet;
Symbols\SignatureComparer.cs (3)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction)
Symbols\SymbolEquivalenceComparer.cs (2)
202if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 207if (x.MethodKind == MethodKind.FunctionPointerSignature)
Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (11)
184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 249private static bool AreCompatibleMethodKinds(MethodKind kind1, MethodKind kind2) 256if ((kind1 == MethodKind.Ordinary && kind2.IsPropertyAccessor()) || 257(kind1.IsPropertyAccessor() && kind2 == MethodKind.Ordinary)) 263if ((kind1 == MethodKind.BuiltinOperator && kind2 == MethodKind.UserDefinedOperator) || 264(kind1 == MethodKind.UserDefinedOperator && kind2 == MethodKind.BuiltinOperator))
Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
Microsoft.CodeAnalysis.Features (115)
AddImport\AbstractAddImportCodeRefactoringProvider.cs (1)
144if (parentSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructor &&
ChangeSignature\AbstractChangeSignatureService.cs (3)
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 (2)
90while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction })
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (3)
352var getMethod = prop.GetMethod != null ? CreateAccessorSymbol(prop, MethodKind.PropertyGet) : null; 353var setMethod = prop.SetMethod != null ? CreateAccessorSymbol(prop, MethodKind.PropertySet) : null; 370private static IMethodSymbol CreateAccessorSymbol(IPropertySymbol prop, MethodKind kind)
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
293MethodKind: MethodKind.BuiltinOperator,
Debugging\AbstractDataTipInfoGetter.cs (1)
47MethodKind: MethodKind.ReducedExtension,
DocumentHighlighting\AbstractDocumentHighlightsService.cs (7)
144case MethodKind.AnonymousFunction: 145case MethodKind.PropertyGet: 146case MethodKind.PropertySet: 147case MethodKind.EventAdd: 148case MethodKind.EventRaise: 149case MethodKind.EventRemove: 171if (symbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (33)
351MethodKind.Constructor => FeaturesResources.constructor, 352MethodKind.PropertyGet or MethodKind.PropertySet => FeaturesResources.property_accessor, 353MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove => FeaturesResources.event_accessor, 354MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator or MethodKind.Conversion => FeaturesResources.operator_, 3864MethodKind.Ordinary or 3865MethodKind.Constructor or 3866MethodKind.EventAdd or 3867MethodKind.EventRemove or 3868MethodKind.EventRaise or 3869MethodKind.Conversion or 3870MethodKind.UserDefinedOperator or 3871MethodKind.PropertyGet or 3872MethodKind.PropertySet 4134return oldMethod.MethodKind == MethodKind.StaticConstructor || HasRestartRequiredAttribute(oldMethod); 4360else if (oldMethod.MethodKind == MethodKind.Conversion) 4364else if (oldMethod.MethodKind == MethodKind.ExplicitInterfaceImplementation || newMethod.MethodKind == MethodKind.ExplicitInterfaceImplementation) 4465if (oldMethod is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: IPropertySymbol oldProperty } && !oldProperty.IsAutoProperty() && 4466newMethod is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: IPropertySymbol newProperty } && newProperty.IsAutoProperty() && 4473if (oldMethod.MethodKind == MethodKind.DeclareMethod || newMethod.MethodKind == MethodKind.DeclareMethod) 5648Contract.ThrowIfFalse(oldCtor is { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor }); 6458var lambda = parameter.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.LambdaMethod or MethodKind.LocalFunction } containingLambda ? 7056=> 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 (4)
79MethodKind: MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.UserDefinedOperator or MethodKind.Conversion
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
67if (method.MethodKind != MethodKind.Constructor)
InlineHints\AbstractInlineParameterNameHintsService.cs (2)
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 (6)
95var methodKind = methodSymbol.MethodKind; 96if (methodKind is not (MethodKind.Ordinary or MethodKind.LocalFunction or MethodKind.Constructor)) 214if (methodSymbol.MethodKind is not MethodKind.Constructor) 224if (methodSymbol.MethodKind is not MethodKind.LocalFunction)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
726var 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 (8)
200if (symbol.MethodKind is MethodKind.UserDefinedOperator or 201MethodKind.BuiltinOperator or 202MethodKind.EventAdd or 203MethodKind.EventRemove or 204MethodKind.PropertySet or 205MethodKind.PropertyGet) 212if (symbol.MethodKind == MethodKind.Constructor) 216else if (symbol.MethodKind == MethodKind.Destructor)
Shared\Extensions\ISymbolExtensions_2.cs (9)
100if (methodSymbol.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion or MethodKind.BuiltinOperator) 105methodSymbol.MethodKind == MethodKind.ReducedExtension || 255case MethodKind.EventAdd: 256case MethodKind.EventRaise: 257case MethodKind.EventRemove: 258case MethodKind.PropertyGet: 259case MethodKind.PropertySet:
src\9547feb31df4cc5d\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
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 (3)
929/// 4. If method, then it is a constructor OR a method with <see cref="MethodKind.Ordinary"/>, 951case MethodKind.Constructor: 981case MethodKind.Ordinary:
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\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (2)
59MethodKind = MethodKind.Conversion; 83MethodKind = MethodKind.Conversion;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (1)
54MethodKind = MethodKind.Ordinary;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (2)
85MethodKind = MethodKind.Ordinary; 124MethodKind = MethodKind.Ordinary;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
41public MethodKind MethodKind { get; internal set; }
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
364return method1.MethodKind == MethodKind.Ordinary && 365method2.MethodKind == MethodKind.Ordinary &&
src\roslyn\src\Analyzers\Core\CodeFixes\Naming\FallbackNamingRules.cs (3)
59var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary)); 78var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary)); 88var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary));
Microsoft.CodeAnalysis.NetAnalyzers (78)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DoNotDeclareStaticMembersOnGenericTypes.cs (1)
54methodSymbol.MethodKind != MethodKind.Ordinary)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DoNotOverloadOperatorEqualsOnReferenceTypes.cs (1)
50if (method.MethodKind != MethodKind.UserDefinedOperator ||
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DoNotRaiseExceptionsInUnexpectedLocations.cs (1)
326return method.MethodKind == MethodKind.StaticConstructor;
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\IdentifiersShouldNotContainUnderscores.cs (1)
192if (methodSymbol.MethodKind == MethodKind.Conversion)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\ImplementIDisposableCorrectly.cs (1)
317if (method.MethodKind == MethodKind.Ordinary && method.IsOverride && method.ReturnsVoid && method.Parameters.IsEmpty)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OperatorOverloadsHaveNamedAlternates.cs (4)
87method.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion) 97Debug.Assert(methodSymbol.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion);
Microsoft.CodeQuality.Analyzers\QualityGuidelines\AvoidInfiniteRecursion.cs (1)
51methodSymbol.MethodKind != MethodKind.PropertySet)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\AvoidMultipleEnumerations\AvoidMultipleEnumerationsHelpers.cs (5)
150if (operation.Parent is IInvocationOperation { TargetMethod.MethodKind: MethodKind.ReducedExtension } parentInvocationOperation 178|| invocationOperation.TargetMethod.MethodKind != MethodKind.ReducedExtension 243var argumentMappingParameter = invokingMethod.MethodKind == MethodKind.ReducedExtension 311var argumentMappingParameter = targetMethod.MethodKind == MethodKind.ReducedExtension 341|| invocationOperation.TargetMethod.MethodKind != MethodKind.ReducedExtension
Microsoft.CodeQuality.Analyzers\QualityGuidelines\DoNotCallOverridableMethodsInConstructors.cs (1)
82if (symbol is not IMethodSymbol m || m.MethodKind != MethodKind.Constructor)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\MarkMembersAsStatic.cs (3)
127if (operation.Parameter.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor }) 236if (methodSymbol.MethodKind == MethodKind.UserDefinedOperator) 305methodSymbol.MethodKind != MethodKind.EventRaise)
Microsoft.NetCore.Analyzers\Data\ReviewSqlQueriesForSecurityVulnerabilities.cs (2)
69if (methodSymbol.MethodKind == MethodKind.Constructor) 86if (invocation.TargetMethod.MethodKind != MethodKind.Constructor)
Microsoft.NetCore.Analyzers\Performance\PreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (2)
116while (symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction or MethodKind.LocalFunction } method)
Microsoft.NetCore.Analyzers\Performance\PreferLengthCountIsEmptyOverAnyAnalyzer.cs (1)
102if (originalMethod.MethodKind == MethodKind.ReducedExtension)
Microsoft.NetCore.Analyzers\Performance\UseConcreteTypeAnalyzer.Collector.cs (1)
714&& methodSym.MethodKind == MethodKind.Ordinary
Microsoft.NetCore.Analyzers\Performance\UseCountProperly.cs (1)
766methodSymbol.MethodKind == MethodKind.PropertyGet &&
Microsoft.NetCore.Analyzers\Runtime\AvoidConstArrays.cs (1)
53if (context.ContainingSymbol is IMethodSymbol method && method.MethodKind == MethodKind.StaticConstructor)
Microsoft.NetCore.Analyzers\Runtime\InitializeStaticFieldsInline.cs (1)
59method.MethodKind != MethodKind.StaticConstructor)
Microsoft.NetCore.Analyzers\Security\DoNotUseObsoleteKDFAlgorithm.cs (1)
63if (methodSymbol.MethodKind == MethodKind.Constructor)
Microsoft.NetCore.Analyzers\Security\UseAutoValidateAntiforgeryToken.cs (1)
277if (actionMethodSymbol.MethodKind == MethodKind.Constructor)
Microsoft.NetFramework.Analyzers\DoNotUseInsecureDtdProcessingInApiDesign.cs (4)
116|| methodSymbol.MethodKind != MethodKind.Constructor 173|| methodSymbol.MethodKind == MethodKind.Constructor 211|| methodSymbol.MethodKind != MethodKind.Constructor 297if (_isFrameworkSecure && methodSymbol.MethodKind == MethodKind.Constructor)
Microsoft.NetFramework.Analyzers\Helpers\SecurityDiagnosticHelpers.cs (2)
239return method.MethodKind == MethodKind.Ordinary ? method.Name : method.ContainingType.Name; 261return method.MethodKind == MethodKind.Ordinary
Microsoft.NetFramework.Analyzers\MarkVerbHandlersWithValidateAntiforgeryTokenAnalyzer.cs (1)
103if (methodSymbol.MethodKind != MethodKind.Ordinary
src\40daf5e1cab76dff\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (2)
636if (method.MethodKind == MethodKind.Constructor 693if (method.MethodKind == MethodKind.Constructor
src\47c588c5b8785708\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (2)
356Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or MethodKind.LocalFunction);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (21)
117if (method.MethodKind == MethodKind.Destructor) 228return method.Name == "Dispose" && method.MethodKind == MethodKind.Ordinary && 247if (method.Name == "Dispose" && method.MethodKind == MethodKind.Ordinary && 264return method.Name == "Close" && method.MethodKind == MethodKind.Ordinary && 284method.MethodKind == MethodKind.Ordinary && 297method.MethodKind == MethodKind.Ordinary && 310method.MethodKind == MethodKind.Ordinary && 425return method.MethodKind == MethodKind.PropertyGet && 434return method.MethodKind == MethodKind.PropertyGet && 443return method.MethodKind is MethodKind.PropertyGet or 444MethodKind.PropertySet; 452return method.MethodKind is MethodKind.EventAdd or 453MethodKind.EventRaise or 454MethodKind.EventRemove; 459return methodSymbol.MethodKind is MethodKind.UserDefinedOperator or MethodKind.BuiltinOperator; 609MethodKind.LambdaMethod or MethodKind.LocalFunction or MethodKind.DelegateInvoke => true, 618MethodKind.LambdaMethod or MethodKind.LocalFunction => true,
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
83return symbol.GetMembers(op).OfType<IMethodSymbol>().Any(m => m.MethodKind == MethodKind.UserDefinedOperator);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\ISymbolExtensions.cs (3)
98return symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 157return symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 162return symbol is IMethodSymbol { MethodKind: MethodKind.Conversion };
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisHelper.cs (1)
154containingMethod.MethodKind == MethodKind.Constructor &&
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\WebInputSources.cs (1)
115|| methodSymbol.MethodKind != MethodKind.Ordinary
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResult.cs (1)
158Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (9)
631Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction); 2479else if (invokedMethod.MethodKind == MethodKind.Constructor) 2550method.MethodKind == MethodKind.DelegateInvoke) 3290if (targetMethod.MethodKind == MethodKind.LocalFunction) 3334if (targetMethod.MethodKind == MethodKind.LocalFunction) 3344Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or 3345MethodKind.DelegateInvoke); 3470computeValueForInvocation: () => method.MethodKind == MethodKind.LocalFunction ? 3621if (methodReference.Method.MethodKind == MethodKind.LocalFunction)
Microsoft.CodeAnalysis.ResxSourceGenerator (101)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (11)
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 && 469MethodKind.LambdaMethod or MethodKind.LocalFunction or MethodKind.DelegateInvoke => true, 478MethodKind.LambdaMethod or MethodKind.LocalFunction => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (3)
325case MethodKind.AnonymousFunction: 326case MethodKind.DelegateInvoke: 338case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
78private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 79private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 283case MethodKind.Ordinary: 286case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
46return method.MethodKind is MethodKind.Ordinary or 47MethodKind.LocalFunction;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (19)
70new SymbolKindOrTypeKind(MethodKind.Ordinary), 71new SymbolKindOrTypeKind(MethodKind.LocalFunction), 169case MethodKind.AnonymousFunction: 170case MethodKind.LocalFunction: 298foreach (var methodKindElement in symbolKindListElement.Elements(nameof(MethodKind))) 349public SymbolKindOrTypeKind(MethodKind methodKind) 356public MethodKind? MethodKind => (_category == SymbolCategory.Method) ? (MethodKind)_kind : null; 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind, 372SymbolCategory.Method => new XElement(nameof(MethodKind), GetMethodKindString((MethodKind)_kind)), 388private static string GetMethodKindString(MethodKind methodKind) 395CodeAnalysis.MethodKind.SharedConstructor => nameof(CodeAnalysis.MethodKind.StaticConstructor), 396CodeAnalysis.MethodKind.AnonymousFunction => nameof(CodeAnalysis.MethodKind.LambdaMethod), 427CodeAnalysis.SymbolKind.Method => new(CodeAnalysis.MethodKind.Ordinary), 436=> new((MethodKind)Enum.Parse(typeof(MethodKind), methodKindElement.Value)); 444public static implicit operator SymbolKindOrTypeKind(MethodKind symbolKind)
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 (2)
76/// cref="IRangeVariableSymbol"/> and <see cref="MethodKind.LocalFunction"/> <see cref="IMethodSymbol"/>s can also 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 (4)
373case MethodKind.AnonymousFunction: 378case MethodKind.BuiltinOperator: 383case MethodKind.ReducedExtension: 388case MethodKind.LocalFunction:
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 (6)
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_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (19)
201MethodKind: MethodKind.Ordinary or 202MethodKind.PropertyGet or 203MethodKind.PropertySet or 204MethodKind.UserDefinedOperator or 205MethodKind.Conversion 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 }; 659=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\MethodKindExtensions.cs (3)
11public static bool IsPropertyAccessor(this MethodKind kind) 12=> kind is MethodKind.PropertyGet or MethodKind.PropertySet;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (3)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction)
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 (11)
184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 249private static bool AreCompatibleMethodKinds(MethodKind kind1, MethodKind kind2) 256if ((kind1 == MethodKind.Ordinary && kind2.IsPropertyAccessor()) || 257(kind1.IsPropertyAccessor() && kind2 == MethodKind.Ordinary)) 263if ((kind1 == MethodKind.BuiltinOperator && kind2 == MethodKind.UserDefinedOperator) || 264(kind1 == MethodKind.UserDefinedOperator && kind2 == MethodKind.BuiltinOperator))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
115if (x.MethodKind == MethodKind.AnonymousFunction)
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (1)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\BasicOverrideEqualsOnOverloadingOperatorEquals.vb (1)
54If Not type.GetMembers(WellKnownMemberNames.EqualityOperatorName).OfType(Of IMethodSymbol).Any(Function(m) m.MethodKind = MethodKind.UserDefinedOperator) Then
Microsoft.CodeAnalysis.Workspaces (167)
Editing\SyntaxGenerator.cs (13)
281if (method.MethodKind is not (MethodKind.UserDefinedOperator or MethodKind.Conversion)) 745case MethodKind.Constructor: 746case MethodKind.SharedConstructor: 749case MethodKind.Destructor: 752case MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation: 755case MethodKind.UserDefinedOperator or MethodKind.Conversion: 883case MethodKind.Constructor: 884case MethodKind.SharedConstructor: 885case MethodKind.UserDefinedOperator: 887case MethodKind.Ordinary:
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (4)
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\NamedTypeSymbolReferenceFinder.cs (1)
45if (member is IMethodSymbol { MethodKind: MethodKind.Destructor })
FindSymbols\FindReferences\Finders\OperatorSymbolReferenceFinder.cs (2)
19=> symbol.MethodKind is MethodKind.UserDefinedOperator or MethodKind.BuiltinOperator;
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (5)
24=> symbol.MethodKind is MethodKind.Ordinary or 25MethodKind.DelegateInvoke or 26MethodKind.DeclareMethod or 27MethodKind.ReducedExtension or 28MethodKind.LocalFunction;
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (2)
175if (declaredSymbol is IMethodSymbol { MethodKind: not MethodKind.AnonymousFunction }) 213if (containingMethod.MethodKind == MethodKind.DelegateInvoke)
FindSymbols\ReferenceLocationExtensions.cs (1)
99if (method.MethodKind != MethodKind.AnonymousFunction)
ReassignedVariable\AbstractReassignedVariableService.cs (2)
184if (methodOrProperty is IMethodSymbol { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet } method)
Recommendations\AbstractRecommendationService.cs (5)
86case MethodKind.EventAdd: 87case MethodKind.EventRemove: 88case MethodKind.EventRaise: 89case MethodKind.PropertyGet: 90case MethodKind.PropertySet:
Recommendations\AbstractRecommendationServiceRunner.cs (1)
68if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.AnonymousFunction } owningMethod)
Rename\RenameUtilities.cs (4)
353if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion } && 395if (symbol is IMethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor or MethodKind.Destructor })
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (4)
211MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor or MethodKind.Destructor, 303var referencedSymbolName = referencedSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructorSymbol
Shared\Extensions\ISymbolExtensions_2.cs (3)
17if (method.MethodKind is MethodKind.EventAdd or 18MethodKind.EventRemove or 19MethodKind.PropertySet)
Shared\Extensions\ISymbolExtensions.cs (2)
474if (methodSymbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor)
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 (3)
325case MethodKind.AnonymousFunction: 326case MethodKind.DelegateInvoke: 338case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
78private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 79private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 283case MethodKind.Ordinary: 286case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
46return method.MethodKind is MethodKind.Ordinary or 47MethodKind.LocalFunction;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (19)
70new SymbolKindOrTypeKind(MethodKind.Ordinary), 71new SymbolKindOrTypeKind(MethodKind.LocalFunction), 169case MethodKind.AnonymousFunction: 170case MethodKind.LocalFunction: 298foreach (var methodKindElement in symbolKindListElement.Elements(nameof(MethodKind))) 349public SymbolKindOrTypeKind(MethodKind methodKind) 356public MethodKind? MethodKind => (_category == SymbolCategory.Method) ? (MethodKind)_kind : null; 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind, 372SymbolCategory.Method => new XElement(nameof(MethodKind), GetMethodKindString((MethodKind)_kind)), 388private static string GetMethodKindString(MethodKind methodKind) 395CodeAnalysis.MethodKind.SharedConstructor => nameof(CodeAnalysis.MethodKind.StaticConstructor), 396CodeAnalysis.MethodKind.AnonymousFunction => nameof(CodeAnalysis.MethodKind.LambdaMethod), 427CodeAnalysis.SymbolKind.Method => new(CodeAnalysis.MethodKind.Ordinary), 436=> new((MethodKind)Enum.Parse(typeof(MethodKind), methodKindElement.Value)); 444public static implicit operator SymbolKindOrTypeKind(MethodKind symbolKind)
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 (2)
76/// cref="IRangeVariableSymbol"/> and <see cref="MethodKind.LocalFunction"/> <see cref="IMethodSymbol"/>s can also 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 (4)
373case MethodKind.AnonymousFunction: 378case MethodKind.BuiltinOperator: 383case MethodKind.ReducedExtension: 388case MethodKind.LocalFunction:
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 (6)
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_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (19)
201MethodKind: MethodKind.Ordinary or 202MethodKind.PropertyGet or 203MethodKind.PropertySet or 204MethodKind.UserDefinedOperator or 205MethodKind.Conversion 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 }; 659=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\MethodKindExtensions.cs (3)
11public static bool IsPropertyAccessor(this MethodKind kind) 12=> kind is MethodKind.PropertyGet or MethodKind.PropertySet;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (3)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction)
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 (11)
184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 249private static bool AreCompatibleMethodKinds(MethodKind kind1, MethodKind kind2) 256if ((kind1 == MethodKind.Ordinary && kind2.IsPropertyAccessor()) || 257(kind1.IsPropertyAccessor() && kind2 == MethodKind.Ordinary)) 263if ((kind1 == MethodKind.BuiltinOperator && kind2 == MethodKind.UserDefinedOperator) || 264(kind1 == MethodKind.UserDefinedOperator && kind2 == MethodKind.BuiltinOperator))
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 (4)
161MethodKind methodKind = MethodKind.Ordinary, 182MethodKind methodKind = MethodKind.Ordinary,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
72public virtual MethodKind MethodKind => MethodKind.Ordinary;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (2)
27public override MethodKind MethodKind => MethodKind.Constructor;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (2)
34public override MethodKind MethodKind => MethodKind.Conversion;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (2)
23public override MethodKind MethodKind => MethodKind.Destructor;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (5)
20public override MethodKind MethodKind { get; } 35MethodKind methodKind = MethodKind.Ordinary, 42Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet); 43this.IsInitOnly = methodKind == MethodKind.PropertySet && isInitOnly;
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)];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (2)
32public override MethodKind MethodKind => MethodKind.UserDefinedOperator;
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 (15)
Filtering\ImplicitSymbolFilter.cs (11)
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.Extensions.Configuration.Binder.SourceGeneration (1)
Parser\ConfigurationBinder.cs (1)
111IMethodReferenceOperation m when m.Method.MethodKind == MethodKind.Constructor => m.Method.ContainingType,
Microsoft.Gen.Logging (1)
Parsing\Parser.Records.cs (1)
72if (m is not IMethodSymbol { MethodKind: MethodKind.Constructor } ctorMethod)
Microsoft.Interop.ComInterfaceGenerator (10)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
68if (method.MethodKind != MethodKind.Ordinary)
ComInterfaceGenerator.cs (7)
323(MethodKind.PropertyGet, IPropertySymbol { IsIndexer: true }) => StubMemberKind.IndexerGetter, 324(MethodKind.PropertySet, IPropertySymbol { IsIndexer: true }) => StubMemberKind.IndexerSetter, 325(MethodKind.PropertyGet, _) => StubMemberKind.PropertyGetter, 326(MethodKind.PropertySet, _) => StubMemberKind.PropertySetter, 394ImmutableArray<Location> parameterLocations = accessor.MethodKind is MethodKind.PropertySet 408int parameterCount = accessor.MethodKind is MethodKind.PropertySet 416if (accessor.MethodKind is MethodKind.PropertySet)
ComMethodInfo.cs (2)
79case IMethodSymbol { MethodKind: MethodKind.Ordinary } method: 146Debug.Assert(method is { IsStatic: false, MethodKind: MethodKind.Ordinary });
Microsoft.Interop.SourceGeneration (2)
SignatureContext.cs (2)
133int valueParameterIndex = method.MethodKind == MethodKind.PropertySet 154ImmutableArray<AttributeData> returnAttributes = method.MethodKind == MethodKind.PropertyGet
Roslyn.Diagnostics.Analyzers (123)
DoNotMixAttributesFromDifferentVersionsOfMEF.cs (1)
103if (member is IMethodSymbol methodSymbol && methodSymbol.MethodKind == MethodKind.Constructor)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (11)
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 && 469MethodKind.LambdaMethod or MethodKind.LocalFunction or MethodKind.DelegateInvoke => true, 478MethodKind.LambdaMethod or MethodKind.LocalFunction => true,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (3)
325case MethodKind.AnonymousFunction: 326case MethodKind.DelegateInvoke: 338case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
78private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 79private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 283case MethodKind.Ordinary: 286case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
46return method.MethodKind is MethodKind.Ordinary or 47MethodKind.LocalFunction;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (19)
70new SymbolKindOrTypeKind(MethodKind.Ordinary), 71new SymbolKindOrTypeKind(MethodKind.LocalFunction), 169case MethodKind.AnonymousFunction: 170case MethodKind.LocalFunction: 298foreach (var methodKindElement in symbolKindListElement.Elements(nameof(MethodKind))) 349public SymbolKindOrTypeKind(MethodKind methodKind) 356public MethodKind? MethodKind => (_category == SymbolCategory.Method) ? (MethodKind)_kind : null; 363SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind, 372SymbolCategory.Method => new XElement(nameof(MethodKind), GetMethodKindString((MethodKind)_kind)), 388private static string GetMethodKindString(MethodKind methodKind) 395CodeAnalysis.MethodKind.SharedConstructor => nameof(CodeAnalysis.MethodKind.StaticConstructor), 396CodeAnalysis.MethodKind.AnonymousFunction => nameof(CodeAnalysis.MethodKind.LambdaMethod), 427CodeAnalysis.SymbolKind.Method => new(CodeAnalysis.MethodKind.Ordinary), 436=> new((MethodKind)Enum.Parse(typeof(MethodKind), methodKindElement.Value)); 444public static implicit operator SymbolKindOrTypeKind(MethodKind symbolKind)
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 (2)
76/// cref="IRangeVariableSymbol"/> and <see cref="MethodKind.LocalFunction"/> <see cref="IMethodSymbol"/>s can also 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 (4)
373case MethodKind.AnonymousFunction: 378case MethodKind.BuiltinOperator: 383case MethodKind.ReducedExtension: 388case MethodKind.LocalFunction:
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 (6)
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_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (19)
201MethodKind: MethodKind.Ordinary or 202MethodKind.PropertyGet or 203MethodKind.PropertySet or 204MethodKind.UserDefinedOperator or 205MethodKind.Conversion 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 }; 659=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\MethodKindExtensions.cs (3)
11public static bool IsPropertyAccessor(this MethodKind kind) 12=> kind is MethodKind.PropertyGet or MethodKind.PropertySet;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (3)
79if ((method1.MethodKind == MethodKind.AnonymousFunction) != 80(method2.MethodKind == MethodKind.AnonymousFunction)) 85if (method1.MethodKind != MethodKind.AnonymousFunction)
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 (11)
184if (x.MethodKind == MethodKind.ReducedExtension) 203if (x.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 249private static bool AreCompatibleMethodKinds(MethodKind kind1, MethodKind kind2) 256if ((kind1 == MethodKind.Ordinary && kind2.IsPropertyAccessor()) || 257(kind1.IsPropertyAccessor() && kind2 == MethodKind.Ordinary)) 263if ((kind1 == MethodKind.BuiltinOperator && kind2 == MethodKind.UserDefinedOperator) || 264(kind1 == MethodKind.UserDefinedOperator && kind2 == MethodKind.BuiltinOperator))
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 (4)
161MethodKind methodKind = MethodKind.Ordinary, 182MethodKind methodKind = MethodKind.Ordinary,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
72public virtual MethodKind MethodKind => MethodKind.Ordinary;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (2)
27public override MethodKind MethodKind => MethodKind.Constructor;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (2)
34public override MethodKind MethodKind => MethodKind.Conversion;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (2)
23public override MethodKind MethodKind => MethodKind.Destructor;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (5)
20public override MethodKind MethodKind { get; } 35MethodKind methodKind = MethodKind.Ordinary, 42Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet); 43this.IsInitOnly = methodKind == MethodKind.PropertySet && isInitOnly;
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)];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (2)
32public override MethodKind MethodKind => MethodKind.UserDefinedOperator;
Roslyn.Diagnostics.CSharp.Analyzers (13)
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 (5)
1126if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1390if (oldSymbolInfo is IMethodSymbol { MethodKind: not (MethodKind.LocalFunction or MethodKind.LambdaMethod) } && 1560if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1561rewrittenMemberSymbol 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 (2)
2025while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)