2447 references to MethodKind
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
339if (invocation.TargetMethod.MethodKind != MethodKind.DelegateInvoke ||
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (1)
111IMethodReferenceOperation m when m.Method.MethodKind == MethodKind.Constructor => m.Method.ContainingType,
GenerateDocumentationAndConfigFiles (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)
109private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 110private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 314case MethodKind.Ordinary: 317case 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.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 }; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\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)
683Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction); 836Debug.Assert(lambda.MethodKind == MethodKind.LambdaMethod); 975Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction);
DynamicallyAccessedMembersAnalyzer.cs (4)
326if ((methodSymbol.MethodKind != MethodKind.PropertyGet && methodSymbol.MethodKind != MethodKind.PropertySet) 338if (methodSymbol.MethodKind == MethodKind.PropertyGet 341|| methodSymbol.MethodKind == MethodKind.PropertySet
ISymbolExtensions.cs (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)
435if (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 (2)
InternalUsageAnalyzer.cs (2)
100if (method.MethodKind != MethodKind.PropertyGet) 107if (method.MethodKind != MethodKind.PropertySet)
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
InternalUsageAnalyzer.cs (2)
100if (method.MethodKind != MethodKind.PropertyGet) 107if (method.MethodKind != MethodKind.PropertySet)
Microsoft.AspNetCore.Mvc.Analyzers (3)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
69return method.MethodKind == MethodKind.Ordinary &&
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
62if (method.MethodKind != MethodKind.Ordinary)
TopLevelParameterNameAnalyzer.cs (1)
41if (method.MethodKind != MethodKind.Ordinary)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
62if (method.MethodKind != MethodKind.Ordinary)
Microsoft.AspNetCore.OpenApi.SourceGenerators (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 (18)
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 }; 87{ MethodKind: MethodKind.Constructor, ContainingType.IsUnion: true } or 89MethodKind: MethodKind.Ordinary, IsStatic: true, Name: WellKnownMemberNames.UnionFactoryMethodName,
Operations\ControlFlowGraph.cs (1)
57Debug.Assert(method.MethodKind == MethodKind.LocalFunction);
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (2)
98Debug.Assert(symbol.MethodKind == MethodKind.LocalFunction); 117Debug.Assert(others.All(((IMethodSymbol m, ILocalFunctionOperation _) tuple) => tuple.m.MethodKind == MethodKind.LocalFunction));
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)
109private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 110private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 314case MethodKind.Ordinary: 317case 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.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 }; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\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\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\ParameterValidationAnalysis\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (2)
358Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or MethodKind.LocalFunction);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (2)
638if (method.MethodKind == MethodKind.Constructor 695if (method.MethodKind == MethodKind.Constructor
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\WebInputSources.cs (1)
117|| methodSymbol.MethodKind != MethodKind.Ordinary
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResult.cs (1)
159Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (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)
109private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 110private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 314case MethodKind.Ordinary: 317case 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.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 }; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\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\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\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (3)
325case MethodKind.AnonymousFunction: 326case MethodKind.DelegateInvoke: 338case MethodKind.LocalFunction:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
109private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 110private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 314case MethodKind.Ordinary: 317case 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.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 }; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\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)
365return method1.MethodKind == MethodKind.Ordinary && 366method2.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 (643)
Binder\Binder.cs (1)
787return symbol.IsExtensionBlockMember() && (symbol.IsStatic || symbol.MethodKind != MethodKind.Ordinary);
Binder\Binder.ValueChecks.cs (7)
1732MethodKind desiredMethodKind = fieldIsStatic ? MethodKind.StaticConstructor : MethodKind.Constructor; 2204if (method.MethodKind == MethodKind.Constructor || method.IsInitOnly) 2878if (method.MethodKind == MethodKind.Constructor) 5749MethodKind.Ordinary, 5789MethodKind.Ordinary,
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) 3372Debug.Assert(memberSymbol is not MethodSymbol { MethodKind: not MethodKind.Constructor } || 3377if (receiverOpt != null || memberSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor })
Binder\Binder_Crefs.cs (4)
275methodKind: MethodKind.Ordinary, 306methodKind: MethodKind.Ordinary, 977MethodKind candidateMethodKind = candidateMethod.MethodKind; 981int signatureMemberArity = candidateMethodKind == MethodKind.Constructor
Binder\Binder_Expressions.cs (11)
1567ContainingMember() is MethodSymbol { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: PropertySymbol { IsIndexer: false } }) 2049return (containingMethod.MethodKind == MethodKind.AnonymousFunction || containingMethod.MethodKind == MethodKind.LocalFunction) && !IsInsideNameof; // false in EE evaluation method 2087(this.ContainingMember() is MethodSymbol { MethodKind: MethodKind.Constructor } containingMember && (object)containingMember != primaryCtor)) && // We are in a non-primary instance constructor 2160this.ContainingMemberOrLambda is MethodSymbol { MethodKind: MethodKind.AnonymousFunction or MethodKind.LocalFunction } && 4912Debug.Assert(constructor.MethodKind == MethodKind.Constructor || 4913constructor.MethodKind == MethodKind.StaticConstructor); // error scenario: constructor initializer on static constructor 6780Debug.Assert(constructor.MethodKind == MethodKind.Constructor || constructor.MethodKind == MethodKind.StaticConstructor);
Binder\Binder_Invocation.cs (2)
839if (result is null && finalApplicableCandidates[0].LeastOverriddenMember.MethodKind != MethodKind.LocalFunction) 928if (singleCandidate.MethodKind != MethodKind.LocalFunction)
Binder\Binder_Lookup.cs (1)
1448else if ((options & LookupOptions.MustBeOperator) != 0 && unwrappedSymbol is not MethodSymbol { MethodKind: MethodKind.UserDefinedOperator })
Binder\Binder_Statements.cs (3)
1840MethodKind.StaticConstructor : 1841MethodKind.Constructor) || 3886if (constructor.MethodKind != MethodKind.Constructor || constructor.IsExtern)
Binder\InMethodBinder.cs (3)
88internal override bool IsNestedFunctionBinder => _methodSymbol.MethodKind == MethodKind.LocalFunction; 273if (((MethodSymbol)newSymbol).MethodKind == MethodKind.LocalFunction) 309if (((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)
252return containingSymbol is MethodSymbol { MethodKind: MethodKind.StaticConstructor } or FieldSymbol { IsStatic: true }; 256return (containingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor } or FieldSymbol { IsStatic: false } or MethodSymbol { IsInitOnly: true }) &&
CodeGen\EmitExpression.cs (1)
2218if (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)
2382Debug.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 (7)
548(method.MethodKind == MethodKind.Constructor || method.IsScriptInitializer) ? processedInstanceInitializers : 549method.MethodKind == MethodKind.StaticConstructor ? processedStaticInitializers : 1123if ((methodSymbol.MethodKind == MethodKind.Constructor || methodSymbol.MethodKind == MethodKind.StaticConstructor) && 1911if (method.MethodKind == MethodKind.StaticConstructor && 2087if (method.MethodKind == MethodKind.Destructor && body != null) 2489if (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; 657return this.MethodKind == MethodKind.Constructor 658|| this.MethodKind == MethodKind.StaticConstructor; 667Debug.Assert(this.MethodKind != MethodKind.Destructor); 671!(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)
70return UnderlyingMethod.AdaptedMethodSymbol.MethodKind == MethodKind.Constructor;
FlowAnalysis\AbstractFlowPass.cs (2)
1470if (method is null || method.MethodKind != MethodKind.Constructor) 1567Debug.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) && 2371if (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 }); 1591return constructorBody is BoundConstructorMethodBody { Initializer: BoundExpressionStatement { Expression: BoundCall { Method: { MethodKind: MethodKind.Constructor } initializerMethod } } } 1875Debug.Assert(getterNullResilienceData is null || symbol is SourcePropertyAccessorSymbol { MethodKind: MethodKind.PropertyGet }); 2291while (enclosingMemberMethod?.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 7106|| method.MethodKind != MethodKind.Ordinary 9145if (((MethodSymbol)symbol).MethodKind == MethodKind.LocalFunction) 10603Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 10605Debug.Assert(TypeSymbol.Equals(targetTypeWithNullability.Type.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions)); 10680Debug.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) 949if ((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.DecisionDagRewriter.cs (3)
155node.Method.MethodKind == MethodKind.LocalFunction || 216if (conversion.Method.MethodKind == MethodKind.LocalFunction) 240node.MethodOpt?.MethodKind == MethodKind.LocalFunction;
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
194if (method.MethodKind is not MethodKind.Ordinary) 677var requiresInstanceReceiver = methodOrIndexer.RequiresInstanceReceiver() && methodOrIndexer is not MethodSymbol { MethodKind: MethodKind.Constructor } and not FunctionPointerMethodSymbol;
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
1054if (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\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)
106Debug.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)
32public override MethodKind MethodKind => MethodKind.Ordinary; 45public 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 (42)
120public MethodKind MethodKind 124return (MethodKind)((_bits >> MethodKindOffset) & MethodKindMask); 165Debug.Assert(EnumUtilities.ContainsAllValues<MethodKind>((int)MethodKindMask)); 189public void InitializeMethodKind(MethodKind methodKind) 650private bool IsDestructor => this.MethodKind == MethodKind.Destructor; 813internal bool SetAssociatedProperty(PEPropertySymbol propertySymbol, MethodKind methodKind) 815Debug.Assert((methodKind == MethodKind.PropertyGet) || (methodKind == MethodKind.PropertySet)); 823internal bool SetAssociatedEvent(PEEventSymbol eventSymbol, MethodKind methodKind) 825Debug.Assert((methodKind == MethodKind.EventAdd) || (methodKind == MethodKind.EventRemove)); 829private bool SetAssociatedPropertyOrEvent(Symbol propertyOrEventSymbol, MethodKind methodKind) 842_packedFlags.MethodKind == default(MethodKind) || 843_packedFlags.MethodKind == MethodKind.Ordinary || 844_packedFlags.MethodKind == MethodKind.ExplicitInterfaceImplementation); 1004if (this.MethodKind == MethodKind.Ordinary && IsValidExtensionMethodSignature() 1068bool isClosedConstructor = MethodKind == MethodKind.Constructor && ContainingType.IsClosed; 1131public override MethodKind MethodKind 1215private MethodKind ComputeMethodKind() 1239return MethodKind.StaticConstructor; 1244return MethodKind.Constructor; 1248return MethodKind.Ordinary; 1278return IsValidStaticUserDefinedOperatorSignature(2) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary; 1290return IsValidStaticUserDefinedOperatorSignature(1) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary; 1294return IsValidStaticUserDefinedOperatorSignature(1) ? MethodKind.Conversion : MethodKind.Ordinary; 1312return IsValidInstanceUserDefinedOperatorSignature(0) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary; 1329return IsValidInstanceUserDefinedOperatorSignature(1) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary; 1333return MethodKind.Ordinary; 1345return MethodKind.Destructor; 1351return MethodKind.DelegateInvoke; 1362return MethodKind.ExplicitInterfaceImplementation; 1365return MethodKind.Ordinary; 1399method.MethodKind == MethodKind.Destructor); 1505this.MethodKind == MethodKind.PropertySet && 1581if (MethodKind == MethodKind.Constructor) 1679Debug.Assert(MethodKind == MethodKind.Constructor); 1701var 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 (10)
222if (candidate is MethodSymbol { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } method) 233if (candidate is MethodSymbol { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } method) 294Debug.Assert(method.MethodKind == MethodKind.Constructor); 302Debug.Assert(method.MethodKind == MethodKind.StaticConstructor); 374Debug.Assert(method.MethodKind != MethodKind.ReducedExtension); 487if ((options & LookupOptions.MustBeOperator) != 0 && member is not MethodSymbol { MethodKind: MethodKind.UserDefinedOperator }) 1963MethodKind: MethodKind.Ordinary, 2001Debug.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)
341public 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; 154if (methodKind == MethodKind.Constructor) 163if (methodKind == MethodKind.StaticConstructor) 189private void CheckModifiers(MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics) 199else if (ContainingType.IsStatic && methodKind == MethodKind.Constructor) 248internal sealed override bool CanBeCallerUnsafe => MethodKind != MethodKind.StaticConstructor;
Symbols\Source\SourceConstructorSymbolBase.cs (1)
65if (MethodKind == MethodKind.StaticConstructor && (_lazyParameters.Length != 0) &&
Symbols\Source\SourceDelegateMethodSymbol.cs (5)
27MethodKind methodKind, 221: base(delegateType, voidType, syntax, MethodKind.Constructor, RefKind.None, DeclarationModifiers.Public) 268: base(delegateType, returnType, syntax, MethodKind.DelegateInvoke, refKind, DeclarationModifiers.Virtual | DeclarationModifiers.Public) 361: base((SourceNamedTypeSymbol)invoke.ContainingType, iAsyncResultType, syntax, MethodKind.Ordinary, RefKind.None, DeclarationModifiers.Virtual | DeclarationModifiers.Public) 401: 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); 244? (MethodKind == MethodKind.EventAdd ? other.AddMethod : other.RemoveMethod) 248? (MethodKind == MethodKind.EventAdd ? other.AddMethod : other.RemoveMethod)
Symbols\Source\SourceFieldLikeEventSymbol.cs (1)
269return IsExtern && this.MethodKind == MethodKind.EventAdd
Symbols\Source\SourceMemberContainerSymbol.cs (48)
2272if (symbol is MethodSymbol { MethodKind: MethodKind.Conversion } conversion) 2349if (method1.OriginalDefinition is SourceMemberMethodSymbol { MethodKind: MethodKind.Constructor } constructor && 2381var methodKind = method1.MethodKind == MethodKind.Constructor ? MessageID.IDS_SK_CONSTRUCTOR : MessageID.IDS_SK_METHOD; 2394var methodName = (method1.MethodKind == MethodKind.Destructor && method2.MethodKind == MethodKind.Destructor) ? 2844if (member.Kind != SymbolKind.Method || ((MethodSymbol)member).MethodKind != MethodKind.Destructor) 4015if (member is MethodSymbol { IsImplicitlyDeclared: false, MethodKind: not (MethodKind.Constructor or MethodKind.StaticConstructor or MethodKind.Destructor or MethodKind.ExplicitInterfaceImplementation) } method && 4555if ((methodSymbol.MethodKind == MethodKind.Ordinary) && 4594if ((methodSymbol.MethodKind == MethodKind.Ordinary) && 4749case MethodKind.Constructor: 4752case MethodKind.Conversion: 4754case MethodKind.UserDefinedOperator: 4756case MethodKind.Destructor: 4759case MethodKind.ExplicitInterfaceImplementation: 4761case MethodKind.Ordinary: 4762case MethodKind.LocalFunction: 4763case MethodKind.PropertyGet: 4764case MethodKind.PropertySet: 4765case MethodKind.EventAdd: 4766case MethodKind.EventRemove: 4767case MethodKind.StaticConstructor: 4811case MethodKind.Constructor: 4812case MethodKind.Conversion: 4813case MethodKind.Destructor: 4814case MethodKind.EventAdd: 4815case MethodKind.EventRemove: 4816case MethodKind.StaticConstructor: 4817case MethodKind.ExplicitInterfaceImplementation: 4819case MethodKind.Ordinary: 4820case MethodKind.UserDefinedOperator: 4821case MethodKind.PropertyGet: 4822case MethodKind.PropertySet: 4858if (m.MethodKind == MethodKind.Constructor && m.ParameterCount == 0) 4900if (hasInitializers && !builder.NonTypeMembersWithPartialImplementations.Any(member => member is MethodSymbol { MethodKind: MethodKind.Constructor })) 5045case MethodSymbol { MethodKind: not (MethodKind.Ordinary or MethodKind.Constructor) }: 5140MethodKind.Ordinary, 5187MethodKind.Constructor, 5240MethodKind.Ordinary, 5300MethodKind.Ordinary, 5474MethodKind.Ordinary, 5567MethodKind.Ordinary, 5659case MethodKind.Constructor: 5669case MethodKind.StaticConstructor: 6279if (member is MethodSymbol { MethodKind: MethodKind.Ordinary })
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\SourceMemberMethodSymbol.cs (13)
126public MethodKind MethodKind 128get { return (MethodKind)((_flags >> MethodKindOffset) & MethodKindMask); } 176Debug.Assert(EnumUtilities.ContainsAllValues<MethodKind>(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 1052if ((!IsStatic || MethodKind is MethodKind.StaticConstructor) &&
Symbols\Source\SourceMethodSymbol.cs (1)
289if (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)
1941&& !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) 201return MethodKind == MethodKind.ExplicitInterfaceImplementation; 271if (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, 665Debug.Assert(this.MethodKind != MethodKind.UserDefinedOperator, "SourceUserDefinedOperatorSymbolBase overrides this"); 710CheckModifiers(MethodKind == MethodKind.ExplicitInterfaceImplementation, _location, diagnostics); 727private static (DeclarationModifiers mods, bool hasExplicitAccessMod) MakeModifiers(MethodDeclarationSyntax syntax, NamedTypeSymbol containingType, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics) 731bool isExplicitInterfaceImplementation = methodKind == MethodKind.ExplicitInterfaceImplementation; 813private static DeclarationModifiers AddImpliedModifiers(DeclarationModifiers mods, bool containingTypeIsInterface, MethodKind methodKind, bool hasBody) 820methodKind == MethodKind.ExplicitInterfaceImplementation, 823else if (methodKind == MethodKind.ExplicitInterfaceImplementation) 968MethodKind methodKind, 1026MethodKind 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, 389if (MethodKind == MethodKind.PropertySet) 411if (this.MethodKind == MethodKind.PropertyGet) 526MethodKind == MethodKind.PropertyGet; 616else if (LocalDeclaredReadOnly && _isAutoPropertyAccessor && MethodKind == MethodKind.PropertySet) 671MethodSymbol implementedAccessor = this.MethodKind == MethodKind.PropertyGet 700Debug.Assert(MethodKind == MethodKind.PropertySet); 734bool isGetMethod = this.MethodKind == MethodKind.PropertyGet; 818bool isGetMethod = this.MethodKind == MethodKind.PropertyGet; 869? (MethodKind == MethodKind.PropertyGet ? other.GetMethod : other.SetMethod) 873? (MethodKind == MethodKind.PropertyGet ? other.GetMethod : other.SetMethod)
Symbols\Source\SourcePropertySymbolBase.cs (4)
348{ MethodKind: MethodKind.PropertyGet, IsInitOnly: false } => SyntaxFacts.GetText(SyntaxKind.GetKeyword), 349{ MethodKind: MethodKind.PropertySet, IsInitOnly: false } => SyntaxFacts.GetText(SyntaxKind.SetKeyword), 350{ MethodKind: MethodKind.PropertySet, IsInitOnly: true } => SyntaxFacts.GetText(SyntaxKind.InitKeyword), 1217Debug.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.cs (14)
676case MethodKind.Ordinary: 677case MethodKind.LocalFunction: 678case MethodKind.ReducedExtension: 680case MethodKind.Destructor: 685case MethodKind.DelegateInvoke: 687case MethodKind.PropertyGet: 688case MethodKind.PropertySet: 737case MethodKind.Ordinary: 738case MethodKind.LocalFunction: 739case MethodKind.DelegateInvoke: 740case MethodKind.Destructor: // See comment in CanBeReferencedByName. 742case MethodKind.PropertyGet: 743case MethodKind.PropertySet: 1255this is MethodSymbol method && method.MethodKind == MethodKind.FunctionPointerSignature ?
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\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)
160MethodKind.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\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\SynthesizedPropertySymbol.cs (2)
59public override MethodKind MethodKind => MethodKind.PropertyGet;
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)
276public 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)
1111if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1375if (oldSymbolInfo is IMethodSymbol { MethodKind: not (MethodKind.LocalFunction or MethodKind.LambdaMethod) } && 1545if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1546rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (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)
106Debug.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.cs (1)
773if (symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction })
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (1)
33if (member is not IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } method)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
15=> conversion is { IsUserDefined: true, MethodSymbol: { MethodKind: MethodKind.Conversion, Name: "op_Implicit" } };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
372MethodKind: MethodKind.ReducedExtension,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
76if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
1111if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1375if (oldSymbolInfo is IMethodSymbol { MethodKind: not (MethodKind.LocalFunction or MethodKind.LambdaMethod) } && 1545if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1546rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
156if (method.MethodKind == MethodKind.Conversion) 162if (method.MethodKind == MethodKind.UserDefinedOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (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.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 }; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
Symbols\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)
346MethodKind.Constructor => FeaturesResources.constructor, 347MethodKind.PropertyGet or MethodKind.PropertySet => FeaturesResources.property_accessor, 348MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove => FeaturesResources.event_accessor, 349MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator or MethodKind.Conversion => FeaturesResources.operator_, 3859MethodKind.Ordinary or 3860MethodKind.Constructor or 3861MethodKind.EventAdd or 3862MethodKind.EventRemove or 3863MethodKind.EventRaise or 3864MethodKind.Conversion or 3865MethodKind.UserDefinedOperator or 3866MethodKind.PropertyGet or 3867MethodKind.PropertySet 4129return oldMethod.MethodKind == MethodKind.StaticConstructor || HasRestartRequiredAttribute(oldMethod); 4355else if (oldMethod.MethodKind == MethodKind.Conversion) 4359else if (oldMethod.MethodKind == MethodKind.ExplicitInterfaceImplementation || newMethod.MethodKind == MethodKind.ExplicitInterfaceImplementation) 4460if (oldMethod is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: IPropertySymbol oldProperty } && !oldProperty.IsAutoProperty() && 4461newMethod is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: IPropertySymbol newProperty } && newProperty.IsAutoProperty() && 4468if (oldMethod.MethodKind == MethodKind.DeclareMethod || newMethod.MethodKind == MethodKind.DeclareMethod) 5643Contract.ThrowIfFalse(oldCtor is { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor }); 6453var lambda = parameter.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.LambdaMethod or MethodKind.LocalFunction } containingLambda ? 7051=> symbol is IMethodSymbol { IsStatic: false, MethodKind: MethodKind.Constructor, DeclaringSyntaxReferences: [_] } && IsPrimaryConstructorDeclaration(GetSymbolDeclarationSyntax(symbol, cancellationToken));
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
152method.MethodKind == MethodKind.Ordinary &&
ExtractMethod\Extensions.cs (1)
21if (methodSymbol?.MethodKind != MethodKind.AnonymousFunction)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (1)
129.Any(m => m.MethodKind == MethodKind.UserDefinedOperator &&
GoToBase\AbstractGoToBaseService.cs (1)
45if (bases.Length == 0 && symbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
InheritanceMargin\AbstractInheritanceMarginService.cs (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)
88var methodKind = methodSymbol.MethodKind; 89if (methodKind is not (MethodKind.Ordinary or MethodKind.LocalFunction or MethodKind.Constructor)) 174if (methodSymbol.MethodKind is not MethodKind.Constructor) 185if (methodSymbol.MethodKind is not MethodKind.LocalFunction)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
720var extension = method.IsExtensionMethod || method.MethodKind == MethodKind.ReducedExtension;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
50public MethodKind MethodKind => _symbol.MethodKind;
PullMemberUp\MemberAndDestinationValidator.cs (1)
47IMethodSymbol { MethodKind: MethodKind.Ordinary } => true,
Rename\SymbolicRenameInfo.cs (1)
204if (symbol.Kind == SymbolKind.Method && ((IMethodSymbol)symbol).MethodKind == MethodKind.UserDefinedOperator)
RQName\RQNodeBuilder.cs (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\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\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction)
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
139var isConstructorInitializer = candidates.All(m => m.MethodKind == MethodKind.Constructor);
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (3)
141if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count) 167if (method.MethodKind != MethodKind.Constructor) 193if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor, DeclaringSyntaxReferences: [var reference] } constructor)
src\roslyn\src\Analyzers\Core\CodeFixes\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)
365return method1.MethodKind == MethodKind.Ordinary && 366method2.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.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)
109private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 110private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 314case MethodKind.Ordinary: 317case 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.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 }; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\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 (534)
Analysis\FlowAnalysis\AbstractFlowPass.vb (2)
1226Debug.Assert(method.Kind <> MethodKind.Constructor) 1297Debug.Assert(method.Kind <> MethodKind.Constructor)
Analysis\FlowAnalysis\DataFlowPass.vb (18)
1231(Me.MethodSymbol.MethodKind = MethodKind.EventAdd AndAlso DirectCast(Me.MethodSymbol.AssociatedSymbol, EventSymbol).IsWindowsRuntimeEvent) Then 1258Case MethodKind.Conversion, MethodKind.UserDefinedOperator 1260Case MethodKind.PropertyGet 1263Debug.Assert(MethodSymbol.MethodKind = MethodKind.Ordinary OrElse MethodSymbol.MethodKind = MethodKind.LambdaMethod) 1270Case MethodKind.Conversion, MethodKind.UserDefinedOperator 1272Case MethodKind.PropertyGet 1275Debug.Assert(MethodSymbol.MethodKind = MethodKind.Ordinary OrElse MethodSymbol.MethodKind = MethodKind.LambdaMethod) 1286Case MethodKind.Conversion, MethodKind.UserDefinedOperator 1288Case MethodKind.PropertyGet 1290Case MethodKind.EventAdd 1321Case MethodKind.LambdaMethod 1324Case MethodKind.Conversion, MethodKind.UserDefinedOperator
Analysis\InitializerRewriter.vb (1)
273If methodSymbol.MethodKind = MethodKind.Constructor Then
Binding\Binder_Delegates.vb (2)
1147Debug.Assert(delegateInvoke.MethodKind = MethodKind.DelegateInvoke) 1238If method.MethodKind = MethodKind.DelegateInvoke AndAlso
Binding\Binder_Expressions.vb (7)
1872Dim containingMethodKind As MethodKind = Me.KindOfContainingMethodAtRunTime() 1874If containingMethodKind = MethodKind.Constructor Then 1878ElseIf containingMethodKind = MethodKind.SharedConstructor Then 1902Private Function KindOfContainingMethodAtRunTime() As MethodKind 1914Return MethodKind.SharedConstructor 1916Return MethodKind.Constructor 1928Return MethodKind.Ordinary ' Looks like a good default.
Binding\Binder_Invocation.vb (2)
58If Me.ContainingMember.Kind = SymbolKind.Method AndAlso DirectCast(Me.ContainingMember, MethodSymbol).MethodKind = MethodKind.Constructor Then 716Return methodGroup.Methods(0).MethodKind = MethodKind.Constructor
Binding\Binder_Lambda.vb (3)
727Dim containingMethodKind As MethodKind = binderForExpressionContainingLambda.KindOfContainingMethodAtRunTime() 730Case MethodKind.SharedConstructor, MethodKind.Constructor
Binding\Binder_Lookup.vb (1)
1963containingMethod.MethodKind = MethodKind.Constructor AndAlso
Binding\Binder_Statements.vb (8)
347If methodSymbol.MethodKind = MethodKind.Constructor Then 416If Not methodSymbol.IsImplicitlyDeclared AndAlso methodSymbol.MethodKind = MethodKind.Constructor Then 1873If DirectCast(altSymbol.ContainingSymbol, MethodSymbol).MethodKind = MethodKind.LambdaMethod Then 5041Debug.Assert(Me.ContainingMember.Kind = SymbolKind.Method AndAlso DirectCast(Me.ContainingMember, MethodSymbol).MethodKind = MethodKind.LambdaMethod) 5052Debug.Assert(Me.ContainingMember.Kind = SymbolKind.Method AndAlso DirectCast(Me.ContainingMember, MethodSymbol).MethodKind = MethodKind.LambdaMethod) 5082Debug.Assert(Me.ContainingMember.Kind = SymbolKind.Method AndAlso DirectCast(Me.ContainingMember, MethodSymbol).MethodKind = MethodKind.LambdaMethod) 5150Debug.Assert(Me.ContainingMember.Kind = SymbolKind.Method AndAlso DirectCast(Me.ContainingMember, MethodSymbol).MethodKind = MethodKind.LambdaMethod) 5162Debug.Assert(Me.ContainingMember.Kind = SymbolKind.Method AndAlso DirectCast(Me.ContainingMember, MethodSymbol).MethodKind = MethodKind.LambdaMethod)
Binding\Binder_Utils.vb (22)
862Debug.Assert(Not (container.Kind = SymbolKind.Method AndAlso DirectCast(container, MethodSymbol).MethodKind = MethodKind.DelegateInvoke)) 902If Not methodSymbol.MethodKind = MethodKind.DeclareMethod Then 1519Friend Shared Function GetAccessorName(name As String, kind As MethodKind, isWinMd As Boolean) As String 1522Case MethodKind.PropertyGet 1524Case MethodKind.PropertySet 1530Case MethodKind.EventAdd 1532Case MethodKind.EventRemove 1534Case MethodKind.EventRaise 1644MethodKindOrdinary = CUInt(MethodKind.Ordinary) << MethodKindShift 1645MethodKindConstructor = CUInt(MethodKind.Constructor) << MethodKindShift 1646MethodKindSharedConstructor = CUInt(MethodKind.SharedConstructor) << MethodKindShift 1647MethodKindDelegateInvoke = CUInt(MethodKind.DelegateInvoke) << MethodKindShift 1648MethodKindOperator = CUInt(MethodKind.UserDefinedOperator) << MethodKindShift 1649MethodKindConversion = CUInt(MethodKind.Conversion) << MethodKindShift 1650MethodKindPropertyGet = CUInt(MethodKind.PropertyGet) << MethodKindShift 1651MethodKindPropertySet = CUInt(MethodKind.PropertySet) << MethodKindShift 1652MethodKindEventAdd = CUInt(MethodKind.EventAdd) << MethodKindShift 1653MethodKindEventRemove = CUInt(MethodKind.EventRemove) << MethodKindShift 1654MethodKindEventRaise = CUInt(MethodKind.EventRaise) << MethodKindShift 1655MethodKindDeclare = CUInt(MethodKind.DeclareMethod) << MethodKindShift 1663Friend Function ToMethodKind(flags As SourceMemberFlags) As MethodKind 1664Return CType((flags >> SourceMemberFlags.MethodKindShift) And SourceMemberFlags.MethodKindMask, MethodKind)
Binding\Binder_XmlLiterals.vb (1)
1922Public Overrides ReadOnly Property MethodKind As MethodKind
Binding\DocumentationCommentCrefBinder.vb (27)
904CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.TrueOperatorName, opInfo, useSiteInfo) 910CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.FalseOperatorName, opInfo, useSiteInfo) 916CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, 925CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.UnaryPlusOperatorName, opInfo, useSiteInfo) 928CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.AdditionOperatorName, opInfo, useSiteInfo) 934CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.UnaryNegationOperatorName, opInfo, useSiteInfo) 937CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.SubtractionOperatorName, opInfo, useSiteInfo) 943CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.MultiplyOperatorName, opInfo, useSiteInfo) 949CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.DivisionOperatorName, opInfo, useSiteInfo) 955CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.IntegerDivisionOperatorName, opInfo, useSiteInfo) 961CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.ModulusOperatorName, opInfo, useSiteInfo) 967CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.ExponentOperatorName, opInfo, useSiteInfo) 973CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.EqualityOperatorName, opInfo, useSiteInfo) 979CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.InequalityOperatorName, opInfo, useSiteInfo) 985CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.LessThanOperatorName, opInfo, useSiteInfo) 991CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.GreaterThanOperatorName, opInfo, useSiteInfo) 997CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.LessThanOrEqualOperatorName, opInfo, useSiteInfo) 1003CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.GreaterThanOrEqualOperatorName, opInfo, useSiteInfo) 1009CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.LikeOperatorName, opInfo, useSiteInfo) 1015CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.ConcatenateOperatorName, opInfo, useSiteInfo) 1021CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, 1030CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, 1039CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.ExclusiveOrOperatorName, opInfo, useSiteInfo) 1045CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, 1054CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, 1063CollectOperatorsAndConversionsInType(type, symbols, MethodKind.Conversion, 1076kind As MethodKind,
Binding\SyntheticBoundTrees\SynthesizedPropertyAccessorBase.vb (2)
72If accessor.MethodKind = MethodKind.PropertyGet Then 88Debug.Assert(accessor.MethodKind = MethodKind.PropertySet)
BoundTree\BoundCall.vb (1)
80Dim isOperator As Boolean = (Method.MethodKind = MethodKind.UserDefinedOperator)
BoundTree\BoundUserDefinedBinaryOperator.vb (1)
41Debug.Assert(underlyingCall.Method.MethodKind = MethodKind.UserDefinedOperator AndAlso underlyingCall.Method.ParameterCount = 2)
BoundTree\BoundUserDefinedConversion.vb (1)
62Debug.Assert(underlyingCall.Method.MethodKind = MethodKind.Conversion AndAlso underlyingCall.Method.ParameterCount = 1)
BoundTree\BoundUserDefinedUnaryOperator.vb (1)
33Debug.Assert(underlyingCall.Method.MethodKind = MethodKind.UserDefinedOperator AndAlso underlyingCall.Method.ParameterCount = 1)
CodeGen\EmitAddress.vb (2)
279Return Me._method.MethodKind = MethodKind.SharedConstructor 281Return Me._method.MethodKind = MethodKind.Constructor AndAlso
Compilation\ClsComplianceChecker.vb (5)
217Dim methodKind As MethodKind = symbol.MethodKind 219Case MethodKind.PropertyGet, MethodKind.PropertySet 232Case MethodKind.EventAdd, MethodKind.EventRemove
Compilation\DocumentationComments\DocumentationCommentCompiler.Common.vb (3)
725Return If(method.MethodKind = MethodKind.DeclareMethod, "declare", 726If(method.MethodKind = MethodKind.UserDefinedOperator OrElse method.MethodKind = MethodKind.Conversion, "operator",
Compilation\DocumentationComments\DocumentationCommentCompiler.Includes.vb (2)
108Me.IsDeclareMethod = method.MethodKind = MethodKind.DeclareMethod 112Me.TypeParamSupported = Not Me.IsDeclareMethod AndAlso method.MethodKind <> MethodKind.UserDefinedOperator
Compilation\DocumentationComments\DocumentationCommentCompiler.Method.vb (3)
92If method.MethodKind = MethodKind.DeclareMethod Then 106If method.MethodKind = MethodKind.UserDefinedOperator OrElse method.MethodKind = MethodKind.DeclareMethod Then
Compilation\MethodCompiler.vb (10)
137DirectCast(symbol, MethodSymbol).MethodKind = MethodKind.Constructor Then 427Dim sourceTypeBinder As Binder = If(method.MethodKind = MethodKind.Ordinary, Nothing, 695If method.MethodKind = MethodKind.SharedConstructor Then 697ElseIf method.MethodKind = MethodKind.Constructor OrElse method.IsScriptInitializer Then 771sourceMethod.MethodKind = MethodKind.Constructor AndAlso 1481If method.MethodKind = MethodKind.Constructor OrElse method.MethodKind = MethodKind.SharedConstructor Then 1819If method.MethodKind = MethodKind.Constructor Then 1855If referencedMethod IsNot Nothing AndAlso referencedMethod.MethodKind = MethodKind.Constructor Then 1916Debug.Assert(constructor.MethodKind = MethodKind.Constructor)
Compilation\SemanticModel.vb (1)
1862(result.Kind = SymbolKind.Method AndAlso DirectCast(result, MethodSymbol).MethodKind = MethodKind.Constructor) Then
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.vb (1)
86If symbol.MethodKind = MethodKind.Conversion Then
Emit\MethodSymbolAdapter.vb (3)
307Return AdaptedMethodSymbol.MethodKind = MethodKind.Constructor 547Dim result = Me.MethodKind = MethodKind.Constructor OrElse 548Me.MethodKind = MethodKind.SharedConstructor
Emit\NamedTypeSymbolAdapter.vb (1)
488If handledEvent.hookupMethod.MethodKind = MethodKind.SharedConstructor Then
Emit\NoPia\EmbeddedMethod.vb (1)
55Return UnderlyingMethod.AdaptedMethodSymbol.MethodKind = MethodKind.Constructor
Emit\SynthesizedPrivateImplementationDetailsSharedConstructor.vb (2)
56Public Overrides ReadOnly Property MethodKind As MethodKind 58Return MethodKind.SharedConstructor
Lowering\Diagnostics\DiagnosticsPass.vb (1)
109If _containingSymbol.MethodKind = MethodKind.LambdaMethod Then
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (1)
391If method.MethodKind = MethodKind.DelegateInvoke Then
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_BinaryOperator.vb (2)
270Debug.Assert(helper.MethodKind = MethodKind.Ordinary OrElse helper.MethodKind = MethodKind.UserDefinedOperator)
Lowering\LambdaRewriter\LambdaFrameConstructor.vb (2)
23Public Overrides ReadOnly Property MethodKind As MethodKind 25Return MethodKind.Constructor
Lowering\LambdaRewriter\LambdaRewriter.Analysis.vb (2)
404If _currentParent.MethodKind <> MethodKind.LambdaMethod Then 431Loop While parent.MethodKind = MethodKind.LambdaMethod AndAlso parent IsNot container
Lowering\LambdaRewriter\LambdaRewriter.vb (4)
563If _innermostFramePointer.Kind = SymbolKind.Parameter AndAlso _topLevelMethod.MethodKind = MethodKind.Constructor AndAlso 1209(closureKind = ClosureKind.Static AndAlso CurrentMethod.MethodKind <> MethodKind.SharedConstructor AndAlso Not referencedMethod.IsGenericMethod) 1419If node.Method.MethodKind = MethodKind.Constructor AndAlso receiver IsNot Nothing AndAlso receiver.IsInstanceReference Then 1466If method.MethodKind = MethodKind.DelegateInvoke AndAlso
Lowering\LocalRewriter\LocalRewriter_BinaryOperators.vb (1)
197If boundCall.Method.MethodKind = MethodKind.PropertyGet AndAlso
Lowering\LocalRewriter\LocalRewriter_Constant.vb (2)
46If currentMethod.MethodKind <> MethodKind.SharedConstructor OrElse 146(currentMethod.MethodKind <> MethodKind.SharedConstructor OrElse
Lowering\LocalRewriter\LocalRewriter_Conversion.vb (2)
978If memberSymbol.MethodKind = MethodKind.Constructor Then 1117If memberSymbol.MethodKind = MethodKind.Constructor Then
Lowering\LocalRewriter\LocalRewriter_LateAddressOf.vb (1)
36Debug.Assert(delegateInvoke.MethodKind = MethodKind.DelegateInvoke)
Lowering\LocalRewriter\LocalRewriter_RaiseEvent.vb (1)
160Dim accessorName As String = Binder.GetAccessorName(invocationListProperty.Name, MethodKind.PropertyGet, isWinMd:=False)
Semantics\Conversions.vb (1)
4177Debug.Assert(toDelegateInvokeMethod.MethodKind = MethodKind.DelegateInvoke)
Semantics\Operators.vb (29)
2814Debug.Assert(method.MethodKind = MethodKind.Conversion) 2836CollectUserDefinedOperators(source, destination, MethodKind.Conversion, 2850opKind As MethodKind, 2911opKind As MethodKind, 2955CollectUserDefinedOperators(argument.Type, Nothing, MethodKind.UserDefinedOperator, 2969CollectUserDefinedOperators(argument.Type, Nothing, MethodKind.UserDefinedOperator, 2992CollectUserDefinedOperators(argument.Type, Nothing, MethodKind.UserDefinedOperator, 2997CollectUserDefinedOperators(argument.Type, Nothing, MethodKind.UserDefinedOperator, 3002CollectUserDefinedOperators(argument.Type, Nothing, MethodKind.UserDefinedOperator, 3028CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3033CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3038CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3043CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3048CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3053CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3058CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3063CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3068CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3073CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3078CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3083CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3088CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3093CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3098CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3104CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3111CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3116CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3122CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator, 3128CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
Semantics\OverloadResolution.vb (2)
971possiblyConstructor.MethodKind = MethodKind.Constructor AndAlso 3756DirectCast(candidate.Candidate.UnderlyingSymbol, MethodSymbol).MethodKind = MethodKind.Constructor AndAlso
SymbolDisplay\SymbolDisplayVisitor.Members.vb (40)
170If symbol.MethodKind = MethodKind.ReducedExtension AndAlso Format.ExtensionMethodStyle = SymbolDisplayExtensionMethodStyle.StaticMethod Then 172ElseIf symbol.MethodKind <> MethodKind.ReducedExtension AndAlso Format.ExtensionMethodStyle = SymbolDisplayExtensionMethodStyle.InstanceMethod Then 197Case MethodKind.Constructor, MethodKind.StaticConstructor 201Case MethodKind.PropertyGet 212Case MethodKind.PropertySet 223Case MethodKind.EventAdd, 224MethodKind.EventRemove, 225MethodKind.EventRaise 233symbol.MethodKind = MethodKind.EventAdd, 236symbol.MethodKind = MethodKind.EventRemove, 244Case MethodKind.Conversion 259Case MethodKind.UserDefinedOperator, MethodKind.BuiltinOperator 270Case MethodKind.Ordinary, 271MethodKind.DelegateInvoke, 272MethodKind.ReducedExtension, 273MethodKind.AnonymousFunction 296If symbol.MethodKind = MethodKind.ReducedExtension Then 311Case MethodKind.Ordinary, MethodKind.DelegateInvoke, MethodKind.DeclareMethod 314Case MethodKind.ReducedExtension 319Case MethodKind.PropertyGet, 320MethodKind.PropertySet, 321MethodKind.EventAdd, 322MethodKind.EventRemove, 323MethodKind.EventRaise 338Case MethodKind.Constructor, MethodKind.StaticConstructor 345Case MethodKind.UserDefinedOperator, MethodKind.BuiltinOperator 361Case MethodKind.Conversion 370Case MethodKind.AnonymousFunction 383If symbol.MethodKind = MethodKind.BuiltinOperator Then 427AddParametersIfRequired(isExtensionMethod:=method.IsExtensionMethod AndAlso method.MethodKind <> MethodKind.ReducedExtension, 436Case MethodKind.Constructor, 437MethodKind.StaticConstructor 687Return vbMethod IsNot Nothing AndAlso vbMethod.MethodKind = MethodKind.DeclareMethod 701DirectCast(symbol, IMethodSymbol).MethodKind = MethodKind.AnonymousFunction OrElse
Symbols\AnonymousTypes\PublicSymbols\AnonymousType_PropertyPublicAccessors.vb (4)
57Public Overrides ReadOnly Property MethodKind As MethodKind 59Return MethodKind.PropertyGet 89Public Overrides ReadOnly Property MethodKind As MethodKind 91Return MethodKind.PropertySet
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_PropertyAccessors.vb (4)
76Public Overrides ReadOnly Property MethodKind As MethodKind 78Return MethodKind.PropertyGet 108Public Overrides ReadOnly Property MethodKind As MethodKind 110Return MethodKind.PropertySet
Symbols\EmbeddedSymbols\EmbeddedSymbolManager.SymbolsCollection.vb (13)
232Dim methKind As MethodKind = DirectCast(symbol, MethodSymbol).MethodKind 234Case MethodKind.PropertyGet, MethodKind.PropertySet 239Case MethodKind.Ordinary, 240MethodKind.Constructor, 241MethodKind.SharedConstructor 288Case MethodKind.SharedConstructor, 289MethodKind.Constructor 372Debug.Assert(kind = MethodKind.Constructor OrElse 373kind = MethodKind.SharedConstructor OrElse 374kind = MethodKind.Ordinary OrElse 375kind = MethodKind.PropertyGet OrElse 376kind = MethodKind.PropertySet)
Symbols\ErrorMethodSymbol.vb (2)
191Public Overrides ReadOnly Property MethodKind As MethodKind 193Return MethodKind.Ordinary
Symbols\Metadata\PE\PEEventSymbol.vb (3)
90Me._addMethod.SetAssociatedEvent(Me, MethodKind.EventAdd) 94Me._removeMethod.SetAssociatedEvent(Me, MethodKind.EventRemove) 98Me._raiseMethod.SetAssociatedEvent(Me, MethodKind.EventRaise)
Symbols\Metadata\PE\PEMethodSymbol.vb (51)
88Public Property MethodKind As MethodKind 90Return CType((_bits >> s_methodKindOffset) And s_methodKindMask, MethodKind) 92Set(value As MethodKind) 162Public Sub InitializeMethodKind(methodKind As MethodKind) 357Public Overrides ReadOnly Property MethodKind As MethodKind 374Private Function ComputeMethodKind() As MethodKind 396Return MethodKind.SharedConstructor 399Return MethodKind.Constructor 403Return MethodKind.Ordinary 417Return MethodKind.Ordinary 422Return MethodKind.DelegateInvoke 425Return MethodKind.Ordinary 430Return _packedFlags.MethodKind = MethodKind.Constructor AndAlso ParameterCount = 0 445_packedFlags.MethodKind = MethodKind.Constructor 452Private Function ComputeMethodKindForPotentialOperatorOrConversion(opInfo As OverloadResolution.OperatorInfo) As MethodKind 458Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.Conversion, WellKnownMemberNames.ExplicitConversionName, True) 460Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.Conversion, WellKnownMemberNames.ImplicitConversionName, True) 462Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 465Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 467Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.OnesComplementOperatorName, False) 491Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 495Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 497Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.BitwiseAndOperatorName, False) 501Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 503Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.BitwiseOrOperatorName, False) 507Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 509Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.LeftShiftOperatorName, False) 513Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 515Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.RightShiftOperatorName, False) 532potentialMethodKind As MethodKind, 535) As MethodKind 536Debug.Assert(potentialMethodKind = MethodKind.Conversion OrElse potentialMethodKind = MethodKind.UserDefinedOperator) 538Dim result As MethodKind = potentialMethodKind 560Case MethodKind.Ordinary 573If potentialMethodKind = MethodKind.Conversion AndAlso Not outputType.IsSameTypeIgnoringAll(contender.ReturnType) Then 589result = MethodKind.Ordinary 593contender._packedFlags.InitializeMethodKind(MethodKind.Ordinary) 644Dim checkForRequiredMembers = MethodKind = MethodKind.Constructor AndAlso 696Me.MethodKind = MethodKind.Ordinary AndAlso 943Me.MethodKind = MethodKind.PropertySet AndAlso 1026Friend Function SetAssociatedProperty(propertySymbol As PEPropertySymbol, methodKind As MethodKind) As Boolean 1027Debug.Assert((methodKind = MethodKind.PropertyGet) OrElse (methodKind = MethodKind.PropertySet)) 1035Friend Function SetAssociatedEvent(eventSymbol As PEEventSymbol, methodKind As MethodKind) As Boolean 1036Debug.Assert((methodKind = MethodKind.EventAdd) OrElse (methodKind = MethodKind.EventRemove) OrElse (methodKind = MethodKind.EventRaise)) 1040Private Function SetAssociatedPropertyOrEvent(propertyOrEventSymbol As Symbol, methodKind As MethodKind) As Boolean 1291MethodKind = MethodKind.Constructor AndAlso 1391If MethodKind <> MethodKind.Constructor Then
Symbols\Metadata\PE\PEPropertySymbol.vb (2)
129_getMethod.SetAssociatedProperty(Me, MethodKind.PropertyGet) 133_setMethod.SetAssociatedProperty(Me, MethodKind.PropertySet)
Symbols\MethodKindExtensions.vb (6)
14Friend Function TryGetAccessorDisplayName(kind As MethodKind) As String 16Case MethodKind.EventAdd 19Case MethodKind.EventRaise 22Case MethodKind.EventRemove 25Case MethodKind.PropertyGet 28Case MethodKind.PropertySet
Symbols\MethodSymbol.vb (11)
23Public MustOverride ReadOnly Property MethodKind As MethodKind 32Return Me.ParameterCount = 0 AndAlso Me.MethodKind = MethodKind.Constructor 230Me.MethodKind <> MethodKind.PropertySet AndAlso 323Return DirectCast(Me.AssociatedSymbol, PropertySymbol).GetAccessorOverride(getter:=(MethodKind = MethodKind.PropertyGet)) 426Return IsExtensionMethod AndAlso MethodKind <> MethodKind.ReducedExtension 457Case MethodKind.Ordinary, 458MethodKind.Constructor, 459MethodKind.UserDefinedOperator, 460MethodKind.ReducedExtension 496Return Me.MethodKind = MethodKind.Constructor AndAlso Me.ContainingType.IsScriptClass 957Private ReadOnly Property IMethodSymbol_MethodKind As MethodKind Implements IMethodSymbol.MethodKind
Symbols\MethodSymbolExtensions.vb (2)
86Case MethodKind.UserDefinedOperator, MethodKind.Conversion
Symbols\NamedTypeSymbol.vb (2)
423Debug.Assert(method.MethodKind = MethodKind.Constructor) 431Debug.Assert(method.MethodKind = MethodKind.StaticConstructor)
Symbols\ObsoleteAttributeHelpers.vb (1)
163Dim accessorString = If(accessorSymbol.MethodKind = MethodKind.PropertyGet, "Get", "Set")
Symbols\PropertySymbol.vb (1)
172If If(TryCast(containingMember, MethodSymbol)?.MethodKind <> MethodKind.Constructor, True) Then
Symbols\ReducedExtensionMethodSymbol.vb (4)
49possiblyExtensionMethod.MethodKind <> MethodKind.ReducedExtension) Then 185If Not possiblyExtensionMethod.IsExtensionMethod OrElse possiblyExtensionMethod.MethodKind = MethodKind.ReducedExtension Then 353Public Overrides ReadOnly Property MethodKind As MethodKind 355Return MethodKind.ReducedExtension
Symbols\Retargeting\RetargetingMethodSymbol.vb (1)
438Public Overrides ReadOnly Property MethodKind As MethodKind
Symbols\SignatureOnlyMethodSymbol.vb (3)
23Private ReadOnly _methodKind As MethodKind 34Public Sub New(ByVal name As String, ByVal m_containingType As TypeSymbol, ByVal methodKind As MethodKind, ByVal callingConvention As CallingConvention, ByVal typeParameters As ImmutableArray(Of TypeParameterSymbol), ByVal parameters As ImmutableArray(Of ParameterSymbol), 124Public Overrides ReadOnly Property MethodKind() As MethodKind
Symbols\Source\CustomEventAccessorSymbol.vb (6)
57If Me.MethodKind = MethodKind.EventRaise Then 144Return Not (Me.MethodKind = MethodKind.EventAdd AndAlso _event.IsWindowsRuntimeEvent) 168If(Me.MethodKind = MethodKind.EventRaise, 175If Me.MethodKind = MethodKind.EventRaise Then 215If Me.MethodKind = MethodKind.EventAdd Then 221Debug.Assert(Me.MethodKind = MethodKind.EventRemove)
Symbols\Source\LambdaSymbol.vb (2)
276Public Overrides ReadOnly Property MethodKind As MethodKind 278Return MethodKind.LambdaMethod
Symbols\Source\LocalSymbol.vb (1)
155Debug.Assert((Me.IsFunctionValue AndAlso _container.Kind = SymbolKind.Method AndAlso DirectCast(_container, MethodSymbol).MethodKind = MethodKind.LambdaMethod) OrElse type.Equals(ComputeType()))
Symbols\Source\OverrideHidingHelper.vb (17)
497Case MethodKind.LambdaMethod, MethodKind.Constructor, MethodKind.SharedConstructor 499Case MethodKind.Conversion, MethodKind.DelegateInvoke, MethodKind.UserDefinedOperator, MethodKind.Ordinary, MethodKind.DeclareMethod, 500MethodKind.EventAdd, MethodKind.EventRaise, MethodKind.EventRemove, 501MethodKind.PropertyGet, MethodKind.PropertySet 626(DirectCast(DirectCast(overridingSym, Symbol), MethodSymbol).MethodKind = MethodKind.PropertyGet OrElse 627DirectCast(DirectCast(overridingSym, Symbol), MethodSymbol).MethodKind = MethodKind.PropertySet))) 688(DirectCast(DirectCast(overridingSym, Symbol), MethodSymbol).MethodKind = MethodKind.PropertyGet OrElse 689DirectCast(DirectCast(overridingSym, Symbol), MethodSymbol).MethodKind = MethodKind.PropertySet)))
Symbols\Source\SourceDeclareMethodSymbol.vb (1)
36Debug.Assert(MyBase.MethodKind = MethodKind.DeclareMethod)
Symbols\Source\SourceDelegateMethodSymbol.vb (1)
199Return Me.MethodKind = MethodKind.Constructor
Symbols\Source\SourceEventSymbol.vb (7)
105Case MethodKind.EventAdd 112Case MethodKind.EventRemove 119Case MethodKind.EventRaise 389Friend Function GetAccessorImplementations(kind As MethodKind) As ImmutableArray(Of MethodSymbol) 403Case MethodKind.EventAdd 405Case MethodKind.EventRemove 407Case MethodKind.EventRaise
Symbols\Source\SourceMemberContainerTypeSymbol.vb (19)
963Case MethodKind.EventAdd, MethodKind.EventRemove, MethodKind.PropertyGet, MethodKind.PropertySet 976If syntax Is Nothing AndAlso method.MethodKind = MethodKind.DelegateInvoke Then 1750If method IsNot Nothing AndAlso method.IsPartial AndAlso method.MethodKind = MethodKind.Ordinary Then 1800If candidate IsNot Nothing AndAlso candidate IsNot originalPartialMethod AndAlso candidate.MethodKind = MethodKind.Ordinary Then 2476Return sourceMethodSymbol.MethodKind = MethodKind.Ordinary OrElse sourceMethodSymbol.MethodKind = MethodKind.DeclareMethod 2779(DirectCast(sym, MethodSymbol).MethodKind = MethodKind.Constructor OrElse 2780DirectCast(sym, MethodSymbol).MethodKind = MethodKind.SharedConstructor) 2784If method.MethodKind = MethodKind.Constructor AndAlso method.ParameterCount = 0 Then 3454method.MethodKind <> MethodKind.Ordinary AndAlso 3455method.MethodKind <> MethodKind.UserDefinedOperator AndAlso 3456method.MethodKind <> MethodKind.Conversion Then 3618Dim methodMethodKind As MethodKind = method.MethodKind 3621Case MethodKind.Conversion 3623Case MethodKind.UserDefinedOperator 3643If methodMethodKind = MethodKind.Conversion Then
Symbols\Source\SourceMemberMethodSymbol.vb (1)
108If MethodKind = MethodKind.Ordinary Then
Symbols\Source\SourceMethodSymbol.vb (30)
630Public Overrides ReadOnly Property MethodKind As MethodKind 1275Debug.Assert(Me.MethodKind <> MethodKind.EventAdd, 1500If Not (Me.MethodKind <> MethodKind.Ordinary AndAlso Me.MethodKind <> MethodKind.DeclareMethod) AndAlso 1624If Me.MethodKind <> MethodKind.Ordinary AndAlso Me.MethodKind <> MethodKind.DeclareMethod Then 1809Case MethodKind.DeclareMethod 1813Case MethodKind.PropertyGet, MethodKind.PropertySet 1817Case MethodKind.EventAdd, MethodKind.EventRaise, MethodKind.EventRemove 1901Debug.Assert(MethodKind <> MethodKind.DeclareMethod) 1992Case MethodKind.Constructor, 1993MethodKind.SharedConstructor, 1994MethodKind.PropertyGet, 1995MethodKind.PropertySet, 1996MethodKind.EventAdd, 1997MethodKind.EventRemove, 1998MethodKind.EventRaise, 1999MethodKind.Conversion, 2000MethodKind.UserDefinedOperator 2287Case MethodKind.Constructor, 2288MethodKind.SharedConstructor, 2289MethodKind.EventRemove, 2290MethodKind.EventRaise 2295Case MethodKind.EventAdd 2301Case MethodKind.PropertyGet, MethodKind.PropertySet 2323If Me.MethodKind = MethodKind.UserDefinedOperator Then
Symbols\Source\SourceNamedTypeSymbol.vb (2)
2766If method.MethodKind = MethodKind.Constructor AndAlso method.ParameterCount = 0 Then 2775If method.MethodKind = MethodKind.Constructor AndAlso method.CanBeCalledWithNoParameters() Then
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (8)
383If DirectCast(member, MethodSymbol).MethodKind <> MethodKind.Ordinary Then 549Debug.Assert(method.MethodKind = MethodKind.Ordinary) 1235Public Overrides ReadOnly Property MethodKind As MethodKind 1238Case MethodKind.PropertyGet 1239Return MethodKind.PropertyGet 1240Case MethodKind.PropertySet 1241Return MethodKind.PropertySet 1243Return MethodKind.Ordinary
Symbols\Source\SourceNamedTypeSymbol_GroupClass.vb (2)
402ConflictsWithExistingMemberOrType(binder.GetAccessorName(propertyName, MethodKind.PropertyGet, False), membersBuilder, nestedTypes, conflictsWith) OrElse 403(disposeMethod.Length > 0 AndAlso ConflictsWithExistingMemberOrType(binder.GetAccessorName(propertyName, MethodKind.PropertySet, isWinMd), membersBuilder, nestedTypes, conflictsWith)) OrElse
Symbols\Source\SourceParameterSymbol.vb (8)
103If If(TryCast(Me.ContainingSymbol, MethodSymbol)?.MethodKind = MethodKind.DelegateInvoke, False) AndAlso 186If containingSymbol.Kind = SymbolKind.Method AndAlso DirectCast(containingSymbol, MethodSymbol).MethodKind = MethodKind.DeclareMethod Then 208Case MethodKind.Conversion, 209MethodKind.UserDefinedOperator, 210MethodKind.EventAdd, 211MethodKind.EventRemove 452If methodSymbol.MethodKind = MethodKind.DeclareMethod Then 496DirectCast(ContainingSymbol, MethodSymbol).MethodKind = MethodKind.DeclareMethod Then
Symbols\Source\SourcePropertyAccessorSymbol.vb (11)
37If(flags.ToMethodKind() = MethodKind.PropertyGet, flags, flags And Not SourceMemberFlags.Iterator), 106If methodKind = MethodKind.PropertySet Then 122Return m_property.GetAccessorOverride(getter:=(MethodKind = MethodKind.PropertyGet)) 227Case MethodKind.PropertyGet 240Case MethodKind.PropertySet 294Return If(MethodKind = MethodKind.PropertyGet, 339m_property.GetAccessorImplementations(getter:=(MethodKind = MethodKind.PropertyGet)), 354Return If(Me.MethodKind = MethodKind.PropertySet, ImmutableArray(Of CustomModifier).Empty, m_property.TypeCustomModifiers) 368Debug.Assert(Me.MethodKind = MethodKind.PropertySet) 374Return If(Me.MethodKind = MethodKind.PropertyGet, m_property, Nothing) 397Dim isSetter As Boolean = (method.MethodKind = MethodKind.PropertySet)
Symbols\Source\SourcePropertySymbol.vb (2)
205Binder.GetAccessorName(prop.Name, MethodKind.PropertyGet, isWinMd:=False), 214Binder.GetAccessorName(prop.Name, MethodKind.PropertySet,
Symbols\Source\SynthesizedEntryPointSymbol.vb (2)
163Public Overrides ReadOnly Property MethodKind As MethodKind 165Return MethodKind.Ordinary
Symbols\Source\SynthesizedEventAccessorSymbol.vb (8)
54If Me.MethodKind = MethodKind.EventRemove AndAlso m_propertyOrEvent.IsWindowsRuntimeEvent Then 84useSiteInfo = If(Me.MethodKind = MethodKind.EventRemove, Binder.GetUseSiteInfoForSpecialType(type), Nothing) 104Return Not (Me.MethodKind = MethodKind.EventAdd AndAlso m_propertyOrEvent.IsWindowsRuntimeEvent) 110Return ConstructFieldLikeEventAccessorBody(Me.m_propertyOrEvent, Me.MethodKind = MethodKind.EventAdd, compilation, diagnostics) 541Public Overrides ReadOnly Property MethodKind As MethodKind 543Return MethodKind.EventAdd 556Public Overrides ReadOnly Property MethodKind As MethodKind 558Return MethodKind.EventRemove
Symbols\Source\SynthesizedInteractiveInitializerMethod.vb (2)
105Public Overrides ReadOnly Property MethodKind As MethodKind 107Return MethodKind.Ordinary
Symbols\Source\SynthesizedMyGroupCollectionPropertyAccessorSymbol.vb (4)
158Public Overrides ReadOnly Property MethodKind As MethodKind 160Return MethodKind.PropertyGet 203Public Overrides ReadOnly Property MethodKind As MethodKind 205Return MethodKind.PropertySet
Symbols\Source\SynthesizedWithEventsAccessorSymbol.vb (6)
45Return sourceProperty.GetAccessorImplementations(getter:=(MethodKind = MethodKind.PropertyGet)) 53Return ContainingProperty.GetAccessorOverride(getter:=(MethodKind = MethodKind.PropertyGet)) 130Public Overrides ReadOnly Property MethodKind As MethodKind 132Return MethodKind.PropertyGet 178Public Overrides ReadOnly Property MethodKind As MethodKind 180Return MethodKind.PropertySet
Symbols\SubstitutedMethodSymbol.vb (1)
283Public Overrides ReadOnly Property MethodKind As MethodKind
Symbols\SubstitutedNamedType.vb (6)
463Case MethodKind.PropertyGet, MethodKind.PropertySet 466Return If(memberMethod.MethodKind = MethodKind.PropertyGet, propertySymbol.GetMethod, propertySymbol.SetMethod) 468Case MethodKind.EventAdd 473Case MethodKind.EventRemove 478Case MethodKind.EventRaise
Symbols\Symbol.vb (12)
632Case MethodKind.Ordinary, MethodKind.DeclareMethod, MethodKind.ReducedExtension 634Case MethodKind.DelegateInvoke, MethodKind.UserDefinedOperator, MethodKind.Conversion 672Case MethodKind.Ordinary, MethodKind.DeclareMethod, MethodKind.ReducedExtension, MethodKind.DelegateInvoke, MethodKind.UserDefinedOperator, MethodKind.Conversion
Symbols\Symbol_Attributes.vb (12)
75Case MethodKind.Constructor, 76MethodKind.SharedConstructor 79Case MethodKind.Ordinary, 80MethodKind.DeclareMethod, 81MethodKind.UserDefinedOperator, 82MethodKind.Conversion, 83MethodKind.PropertyGet, 84MethodKind.PropertySet, 85MethodKind.EventAdd, 86MethodKind.EventRaise, 87MethodKind.EventRemove, 88MethodKind.DelegateInvoke
Symbols\SymbolExtensions.vb (6)
59Case MethodKind.Conversion, MethodKind.UserDefinedOperator, MethodKind.BuiltinOperator 263Return kind = MethodKind.Constructor OrElse kind = MethodKind.SharedConstructor 456While If(member?.Kind = SymbolKind.Method, False) AndAlso DirectCast(member, MethodSymbol).MethodKind = MethodKind.AnonymousFunction
Symbols\SynthesizedSymbols\SynthesizedConstructorBase.vb (3)
190Public NotOverridable Overrides ReadOnly Property MethodKind As MethodKind 192Return If(m_isShared, MethodKind.SharedConstructor, MethodKind.Constructor)
Symbols\SynthesizedSymbols\SynthesizedDelegateMethodSymbol.vb (2)
315Public Overrides ReadOnly Property MethodKind As MethodKind 419Return Me.MethodKind = MethodKind.Constructor
Symbols\SynthesizedSymbols\SynthesizedGlobalMethodBase.vb (2)
159Public Overrides ReadOnly Property MethodKind As MethodKind 161Return MethodKind.Ordinary
Symbols\SynthesizedSymbols\SynthesizedInterfaceImplementationStubSymbol.vb (2)
172Public Overrides ReadOnly Property MethodKind As MethodKind 174Return MethodKind.Ordinary
Symbols\SynthesizedSymbols\SynthesizedIntrinsicOperatorSymbol.vb (2)
158Public Overrides ReadOnly Property MethodKind As MethodKind 160Return MethodKind.BuiltinOperator
Symbols\SynthesizedSymbols\SynthesizedMethod.vb (2)
197Public Overrides ReadOnly Property MethodKind As MethodKind 199Return MethodKind.Ordinary
Symbols\SynthesizedSymbols\SynthesizedParameterSymbol.vb (2)
106Debug.Assert(propertySetter.MethodKind = MethodKind.PropertySet) 116If method.MethodKind = MethodKind.PropertySet AndAlso
Symbols\SynthesizedSymbols\SynthesizedRegularMethodBase.vb (2)
140Public NotOverridable Overrides ReadOnly Property MethodKind As MethodKind 142Return MethodKind.Ordinary
Symbols\WellKnownMembers.vb (4)
428Dim targetMethodKind As MethodKind = MethodKind.Ordinary 435targetMethodKind = MethodKind.Constructor 443targetMethodKind = MethodKind.PropertyGet
Symbols\Wrapped\WrappedMethodSymbol.vb (1)
168Public Overrides ReadOnly Property MethodKind As MethodKind
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
159methodSymbol?.MethodKind = MethodKind.Ordinary AndAlso 397If method.MethodKind = MethodKind.ReducedExtension AndAlso
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (5)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
183Return If(methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.Constructor, methodSymbol, Nothing)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
163methodKind:=MethodKind.Conversion)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
152If method.MethodKind = MethodKind.UserDefinedOperator Then 156If method.MethodKind = MethodKind.Conversion Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (1)
19If symbol.IsStatic AndAlso Not symbol.MethodKind = MethodKind.ReducedExtension Then
Microsoft.CodeAnalysis.VisualBasic.Features (14)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
359If methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.ReducedExtension Then
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (2)
164If methodSymbol.MethodKind = MethodKind.PropertyGet Then 166ElseIf methodSymbol.MethodKind = MethodKind.PropertySet Then
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (6)
619If method Is Nothing OrElse (method.MethodKind <> MethodKind.Constructor AndAlso method.MethodKind <> MethodKind.SharedConstructor) Then 1429Case MethodKind.StaticConstructor 1431Case MethodKind.LambdaMethod 2022If method.MethodKind = MethodKind.Conversion OrElse method.MethodKind = MethodKind.UserDefinedOperator Then
NavigationBar\VisualBasicNavigationBarItemService.vb (3)
276Return method.MethodKind = MethodKind.Ordinary OrElse 277method.MethodKind = MethodKind.UserDefinedOperator OrElse 278method.MethodKind = MethodKind.Conversion
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
183Return If(methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.Constructor, methodSymbol, Nothing)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
163methodKind:=MethodKind.Conversion)
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.VisualBasic.Workspaces (13)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (1)
169(symbol.IsKind(SymbolKind.Method) AndAlso DirectCast(symbol, IMethodSymbol).MethodKind = MethodKind.Constructor)
Classification\SyntaxClassification\NameSyntaxClassifier.vb (3)
212Case MethodKind.Constructor 224Case MethodKind.BuiltinOperator, 225MethodKind.UserDefinedOperator
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.vb (1)
42DirectCast(symbolInfo.Symbol, IMethodSymbol).MethodKind = MethodKind.UserDefinedOperator Then
CodeCleanup\Providers\AddMissingTokensCodeCleanupProvider.vb (1)
125Function(s) If(TryCast(s, IMethodSymbol)?.MethodKind = MethodKind.Ordinary, False))
Recommendations\VisualBasicRecommendationServiceRunner.vb (2)
343symbols = symbols.WhereAsArray(Function(s) s.Kind <> SymbolKind.Method OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.UserDefinedOperator) 382If method IsNot Nothing AndAlso method.MethodKind = MethodKind.Constructor Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
159methodSymbol?.MethodKind = MethodKind.Ordinary AndAlso 397If method.MethodKind = MethodKind.ReducedExtension AndAlso
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
152If method.MethodKind = MethodKind.UserDefinedOperator Then 156If method.MethodKind = MethodKind.Conversion Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (1)
19If symbol.IsStatic AndAlso Not symbol.MethodKind = MethodKind.ReducedExtension Then
Microsoft.CodeAnalysis.Workspaces (166)
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\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, 297var referencedSymbolName = referencedSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructorSymbol
Shared\Extensions\ISymbolExtensions.cs (2)
474if (methodSymbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor)
Shared\Extensions\ISymbolExtensions_2.cs (3)
17if (method.MethodKind is MethodKind.EventAdd or 18MethodKind.EventRemove or 19MethodKind.PropertySet)
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)
109private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 110private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 314case MethodKind.Ordinary: 317case 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.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 }; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\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.Gen.Logging (1)
Parsing\Parser.Records.cs (1)
72if (m is not IMethodSymbol { MethodKind: MethodKind.Constructor } ctorMethod)
Microsoft.Interop.ComInterfaceGenerator (3)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
68if (method.MethodKind != MethodKind.Ordinary)
ComMethodInfo.cs (2)
58case IMethodSymbol { MethodKind: MethodKind.Ordinary }: 89Debug.Assert(method is { IsStatic: false, MethodKind: MethodKind.Ordinary });
Roslyn.Diagnostics.Analyzers (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)
109private static readonly SymbolKindOrTypeKind s_method = new(MethodKind.Ordinary); 110private static readonly SymbolKindOrTypeKind s_localFunction = new(MethodKind.LocalFunction); 314case MethodKind.Ordinary: 317case 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.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 }; 649=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
156if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\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)
1111if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1375if (oldSymbolInfo is IMethodSymbol { MethodKind: not (MethodKind.LocalFunction or MethodKind.LambdaMethod) } && 1545if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1546rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
156if (method.MethodKind == MethodKind.Conversion) 162if (method.MethodKind == MethodKind.UserDefinedOperator)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
2025while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Roslyn.Diagnostics.VisualBasic.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
159methodSymbol?.MethodKind = MethodKind.Ordinary AndAlso 397If method.MethodKind = MethodKind.ReducedExtension AndAlso
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
152If method.MethodKind = MethodKind.UserDefinedOperator Then 156If method.MethodKind = MethodKind.Conversion Then