2618 references to MethodKind
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (1)
111IMethodReferenceOperation m when m.Method.MethodKind == MethodKind.Constructor => m.Method.ContainingType,
ILLink.RoslynAnalyzer (18)
DataFlow\LocalDataFlowAnalysis.cs (2)
82 methodSymbol.MethodKind is not (MethodKind.LambdaMethod or MethodKind.LocalFunction));
DataFlow\LocalDataFlowVisitor.cs (3)
574 Debug.Assert (localFunction.MethodKind == MethodKind.LocalFunction); 717 Debug.Assert (lambda.MethodKind == MethodKind.LambdaMethod); 824 Debug.Assert (localFunction.MethodKind == MethodKind.LocalFunction);
DynamicallyAccessedMembersAnalyzer.cs (4)
281 if ((methodSymbol.MethodKind != MethodKind.PropertyGet && methodSymbol.MethodKind != MethodKind.PropertySet) 288 if (methodSymbol.MethodKind == MethodKind.PropertyGet 291 || methodSymbol.MethodKind == MethodKind.PropertySet
ISymbolExtensions.cs (3)
202 => (symbol as IMethodSymbol)?.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor; 205 => (symbol as IMethodSymbol)?.MethodKind == MethodKind.StaticConstructor;
TrimAnalysis\FlowAnnotations.cs (2)
159 if (parameterMethod!.MethodKind == MethodKind.PropertySet 180 if (method.MethodKind is MethodKind.PropertyGet && returnDamt == DynamicallyAccessedMemberTypes.None) {
TrimAnalysis\HandleCallAction.cs (2)
236 if (method.Method.MethodKind == MethodKind.PropertyGet || method.Method.MethodKind == MethodKind.PropertySet) {
TrimAnalysis\MethodReturnValue.cs (1)
22 Debug.Assert (!isNewObj || methodSymbol.MethodKind == MethodKind.Constructor, "isNewObj can only be true for constructors");
TrimAnalysis\TrimAnalysisVisitor.cs (1)
364 if (method.MethodKind != MethodKind.PropertyGet)
Microsoft.Analyzers.Local (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\Shared\Roslyn\MvcFacts.cs (1)
62if (method.MethodKind != MethodKind.Ordinary)
Microsoft.AspNetCore.Components.Analyzers (2)
InternalUsageAnalyzer.cs (2)
100if (method.MethodKind != MethodKind.PropertyGet) 107if (method.MethodKind != MethodKind.PropertySet)
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
InternalUsageAnalyzer.cs (2)
100if (method.MethodKind != MethodKind.PropertyGet) 107if (method.MethodKind != MethodKind.PropertySet)
Microsoft.AspNetCore.Mvc.Analyzers (3)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
69return method.MethodKind == MethodKind.Ordinary &&
src\Shared\Roslyn\MvcFacts.cs (1)
62if (method.MethodKind != MethodKind.Ordinary)
TopLevelParameterNameAnalyzer.cs (1)
41if (method.MethodKind != MethodKind.Ordinary)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
src\Shared\Roslyn\MvcFacts.cs (1)
62if (method.MethodKind != MethodKind.Ordinary)
Microsoft.CodeAnalysis (15)
CodeGen\CompilationTestData.cs (1)
128var format = (iMethod.MethodKind == MethodKind.UserDefinedOperator) ?
Compilation\Compilation.cs (2)
1531/// cref="MethodKind.BuiltinOperator"/> for a binary operator. Built-in operators are commonly created for 1559/// cref="MethodKind.BuiltinOperator"/> for a unary operator. Built-in operators are commonly created for
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; } 223/// Modifier types that are considered part of the calling convention of this method, if the <see cref="MethodKind"/> is <see cref="MethodKind.FunctionPointerSignature"/> 233/// If this method has <see cref="MethodKind"/> of <see cref="MethodKind.PropertyGet"/> or <see cref="MethodKind.PropertySet"/>, 235/// If this method has <see cref="MethodKind"/> of <see cref="MethodKind.EventAdd"/> or <see cref="MethodKind.EventRemove"/>,
Symbols\ISymbolExtensions.cs (2)
19if (method.MethodKind != MethodKind.ReducedExtension) 184MethodKind: MethodKind.Ordinary,
Microsoft.CodeAnalysis.CodeStyle (95)
src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (1)
19methodSymbol.MethodKind == MethodKind.Constructor &&
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
149return symbol == null || symbol.IsStatic || symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction };
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
705/// 4. If method, then it is a constructor OR a method with <see cref="MethodKind.Ordinary"/>, 729case MethodKind.Constructor: 759case MethodKind.Ordinary:
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (1)
50if (symbol.MethodKind == MethodKind.BuiltinOperator)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (5)
226if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 426if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 427method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 637IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (2)
30MethodKind: MethodKind.Constructor, 62MethodKind: MethodKind.Constructor,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (19)
138if (methodSymbol.MethodKind is MethodKind.Ordinary or 139MethodKind.PropertyGet or 140MethodKind.PropertySet or 141MethodKind.UserDefinedOperator or 142MethodKind.Conversion) 178=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 205=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 214=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 223=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 226=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 229=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 232=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 235=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 238=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 241=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 553=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (1)
153if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\MethodKindExtensions.cs (3)
9public static bool IsPropertyAccessor(this MethodKind kind) 10=> kind is MethodKind.PropertyGet or MethodKind.PropertySet;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (3)
326case MethodKind.AnonymousFunction: 327case MethodKind.DelegateInvoke: 339case MethodKind.LocalFunction:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
130private static readonly SymbolKindOrTypeKind _method = new(MethodKind.Ordinary); 131private static readonly SymbolKindOrTypeKind _localFunction = new(MethodKind.LocalFunction); 365case MethodKind.Ordinary: 368case MethodKind.LocalFunction:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
48return method.MethodKind is MethodKind.Ordinary or 49MethodKind.LocalFunction;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (18)
75new SymbolKindOrTypeKind(MethodKind.Ordinary), 76new SymbolKindOrTypeKind(MethodKind.LocalFunction), 174case MethodKind.AnonymousFunction: 175case MethodKind.LocalFunction: 303foreach (var methodKindElement in symbolKindListElement.Elements(nameof(MethodKind))) 354public SymbolKindOrTypeKind(MethodKind methodKind) 361public MethodKind? MethodKind => (_category == SymbolCategory.Method) ? (MethodKind)_kind : null; 368SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind, 377SymbolCategory.Method => new XElement(nameof(MethodKind), GetMethodKindString((MethodKind)_kind)), 393private static string GetMethodKindString(MethodKind methodKind) 400CodeAnalysis.MethodKind.SharedConstructor => nameof(CodeAnalysis.MethodKind.StaticConstructor), 401CodeAnalysis.MethodKind.AnonymousFunction => nameof(CodeAnalysis.MethodKind.LambdaMethod), 432CodeAnalysis.SymbolKind.Method => new(CodeAnalysis.MethodKind.Ordinary), 441=> new((MethodKind)Enum.Parse(typeof(MethodKind), methodKindElement.Value));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
73/// cref="IRangeVariableSymbol"/> and <see cref="MethodKind.LocalFunction"/> <see cref="IMethodSymbol"/>s can also 319IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
144if (symbol.MethodKind == MethodKind.Conversion)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (4)
370case MethodKind.AnonymousFunction: 375case MethodKind.BuiltinOperator: 380case MethodKind.ReducedExtension: 385case MethodKind.LocalFunction:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
407if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 477if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol && 478newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol) 879((IMethodSymbol)symbol).MethodKind == MethodKind.DelegateInvoke;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (3)
77if ((method1.MethodKind == MethodKind.AnonymousFunction) != 78(method2.MethodKind == MethodKind.AnonymousFunction)) 83if (method1.MethodKind != MethodKind.AnonymousFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (2)
200if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 205if (x.MethodKind == MethodKind.FunctionPointerSignature)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (11)
176if (x.MethodKind == MethodKind.ReducedExtension) 195if (x.MethodKind is MethodKind.AnonymousFunction or 196MethodKind.LocalFunction) 248private static bool AreCompatibleMethodKinds(MethodKind kind1, MethodKind kind2) 255if ((kind1 == MethodKind.Ordinary && kind2.IsPropertyAccessor()) || 256(kind1.IsPropertyAccessor() && kind2 == MethodKind.Ordinary)) 262if ((kind1 == MethodKind.BuiltinOperator && kind2 == MethodKind.UserDefinedOperator) || 263(kind1 == MethodKind.UserDefinedOperator && kind2 == MethodKind.BuiltinOperator))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
112if (x.MethodKind == MethodKind.AnonymousFunction)
Microsoft.CodeAnalysis.CodeStyle.Fixes (34)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
129var isConstructorInitializer = candidates.All(m => m.MethodKind == MethodKind.Constructor);
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
132if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (2)
59MethodKind = MethodKind.Conversion; 83MethodKind = MethodKind.Conversion;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (1)
54MethodKind = MethodKind.Ordinary;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (2)
86MethodKind = MethodKind.Ordinary; 125MethodKind = MethodKind.Ordinary;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
42public MethodKind MethodKind { get; internal set; }
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
368return method1.MethodKind == MethodKind.Ordinary && 369method2.MethodKind == MethodKind.Ordinary &&
src\Analyzers\Core\CodeFixes\Naming\FallbackNamingRules.cs (3)
61var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary)); 80var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary)); 90var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (4)
165MethodKind methodKind = MethodKind.Ordinary, 186MethodKind methodKind = MethodKind.Ordinary,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
77public virtual MethodKind MethodKind => MethodKind.Ordinary;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (2)
34public override MethodKind MethodKind => MethodKind.Constructor;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (2)
41public override MethodKind MethodKind => MethodKind.Conversion;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (2)
25public override MethodKind MethodKind => MethodKind.Destructor;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (5)
25public override MethodKind MethodKind { get; } 40MethodKind methodKind = MethodKind.Ordinary, 47Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet); 48this.IsInitOnly = methodKind == MethodKind.PropertySet && isInitOnly;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (2)
174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)); 184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (2)
40public override MethodKind MethodKind => MethodKind.UserDefinedOperator;
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (6)
src\Features\DiagnosticsTestUtilities\NamingStyles\NamingStylesTestOptionSets.cs (6)
117case MethodKind methodKind: 297ImmutableArray.Create(new SymbolSpecification.SymbolKindOrTypeKind(MethodKind.Ordinary)), 328ImmutableArray.Create(new SymbolSpecification.SymbolKindOrTypeKind(MethodKind.Ordinary)), 549ImmutableArray.Create(new SymbolSpecification.SymbolKindOrTypeKind(MethodKind.LocalFunction)), 766new SymbolSpecification.SymbolKindOrTypeKind(MethodKind.Ordinary), 767new SymbolSpecification.SymbolKindOrTypeKind(MethodKind.LocalFunction)),
Microsoft.CodeAnalysis.CSharp (573)
Binder\Binder.ValueChecks.cs (9)
1450MethodKind desiredMethodKind = fieldIsStatic ? MethodKind.StaticConstructor : MethodKind.Constructor; 1912if (method.MethodKind == MethodKind.Constructor || method.IsInitOnly) 2529if (method.MethodKind == MethodKind.Constructor) 5496MethodKind.Ordinary, 5536MethodKind.Ordinary, 5926return containingSymbol is MethodSymbol { MethodKind: MethodKind.StaticConstructor } or FieldSymbol { IsStatic: true }; 5930return (containingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor } or FieldSymbol { IsStatic: false } or MethodSymbol { IsInitOnly: true }) &&
Binder\Binder_Await.cs (1)
175if (method.MethodKind == MethodKind.AnonymousFunction)
Binder\Binder_Crefs.cs (2)
776MethodKind candidateMethodKind = candidateMethod.MethodKind; 780int signatureMemberArity = candidateMethodKind == MethodKind.Constructor
Binder\Binder_Expressions.cs (9)
1941return (containingMethod.MethodKind == MethodKind.AnonymousFunction || containingMethod.MethodKind == MethodKind.LocalFunction) && !IsInsideNameof; // false in EE evaluation method 2079(this.ContainingMember() is MethodSymbol { MethodKind: MethodKind.Constructor } containingMember && (object)containingMember != primaryCtor)) && // We are in a non-primary instance constructor 2134this.ContainingMemberOrLambda is MethodSymbol { MethodKind: MethodKind.AnonymousFunction or MethodKind.LocalFunction } && 4769Debug.Assert(constructor.MethodKind == MethodKind.Constructor || 4770constructor.MethodKind == MethodKind.StaticConstructor); // error scenario: constructor initializer on static constructor 6578Debug.Assert(constructor.MethodKind == MethodKind.Constructor || constructor.MethodKind == MethodKind.StaticConstructor);
Binder\Binder_Invocation.cs (2)
798if (result is null && finalApplicableCandidates[0].LeastOverriddenMember.MethodKind != MethodKind.LocalFunction) 889if (singleCandidate.MethodKind != MethodKind.LocalFunction)
Binder\Binder_Statements.cs (3)
1797MethodKind.StaticConstructor : 1798MethodKind.Constructor) || 3806if (constructor.MethodKind != MethodKind.Constructor || constructor.IsExtern)
Binder\InMethodBinder.cs (3)
87internal override bool IsNestedFunctionBinder => _methodSymbol.MethodKind == MethodKind.LocalFunction; 272if (((MethodSymbol)newSymbol).MethodKind == MethodKind.LocalFunction) 300if (((MethodSymbol)newSymbol).MethodKind == MethodKind.LocalFunction)
Binder\LocalBinderFactory.cs (1)
311SourcePropertyAccessorSymbol { MethodKind: MethodKind.PropertySet } setter => getSetterParameters(setter),
Binder\LockBinder.cs (1)
122MethodKind: MethodKind.Ordinary,
Binder\MethodGroupResolution.cs (1)
88MethodGroup.Methods[0].MethodKind == MethodKind.LocalFunction;
Binder\Semantics\AccessCheck.cs (1)
196case SymbolKind.Method when ((MethodSymbol)symbol).MethodKind == MethodKind.LocalFunction:
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
512Debug.Assert(firstSupported.Member is MethodSymbol { MethodKind: MethodKind.Constructor });
BoundTree\BoundNodeExtensions.cs (1)
62return method.MethodKind == MethodKind.Constructor &&
CodeGen\EmitExpression.cs (1)
2186if (method.IsEffectivelyReadOnly && method.MethodKind != MethodKind.Constructor)
Compilation\CSharpCompilation.cs (1)
3053if (symbol.Kind == SymbolKind.Method && symbol.IsImplicitlyDeclared && ((MethodSymbol)symbol).MethodKind == MethodKind.Constructor)
Compilation\CSharpSemanticModel.cs (2)
1784case MethodSymbol { MethodKind: MethodKind.LambdaMethod }: 4782if (call.InvokedAsExtensionMethod && method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension)
Compilation\MemberSemanticModel.cs (1)
2342Debug.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)
2386Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod });
Compiler\ClsComplianceChecker.cs (1)
736if (method.MethodKind == MethodKind.DelegateInvoke)
Compiler\MethodBodySynthesizer.cs (5)
176Debug.Assert(accessor.MethodKind == MethodKind.PropertyGet || accessor.MethodKind == MethodKind.PropertySet); 191if (accessor.MethodKind == MethodKind.PropertyGet) 197Debug.Assert(accessor.MethodKind == MethodKind.PropertySet); 532Debug.Assert(method.MethodKind == MethodKind.Destructor);
Compiler\MethodCompiler.cs (7)
533(method.MethodKind == MethodKind.Constructor || method.IsScriptInitializer) ? processedInstanceInitializers : 534method.MethodKind == MethodKind.StaticConstructor ? processedStaticInitializers : 1075if ((methodSymbol.MethodKind == MethodKind.Constructor || methodSymbol.MethodKind == MethodKind.StaticConstructor) && 1760if (method.MethodKind == MethodKind.StaticConstructor && 1936if (method.MethodKind == MethodKind.Destructor && body != null) 2338if (method.MethodKind == MethodKind.Constructor && !method.IsExtern)
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (1)
116if (symbol.MethodKind == MethodKind.Conversion)
Emitter\Model\MethodSymbolAdapter.cs (5)
388return AdaptedMethodSymbol.MethodKind == MethodKind.Constructor; 637return this.MethodKind == MethodKind.Constructor 638|| this.MethodKind == MethodKind.StaticConstructor; 647Debug.Assert(this.MethodKind != MethodKind.Destructor); 651!(this.IsVirtual || this.IsOverride || this.IsAbstract || this.MethodKind == MethodKind.Destructor));
Emitter\Model\NamedTypeSymbolAdapter.cs (3)
358else if (method.MethodKind == MethodKind.Destructor && AdaptedNamedTypeSymbol.SpecialType != SpecialType.System_Object) 369if ((object)objectMethod != null && objectMethod.MethodKind == MethodKind.Destructor) 631if ((alwaysIncludeConstructors && method.MethodKind == MethodKind.Constructor) || method.GetCciAdapter().ShouldInclude(context))
Emitter\Model\PropertySymbolAdapter.cs (3)
78return GetSynthesizedSealedAccessor(MethodKind.PropertyGet); 133return GetSynthesizedSealedAccessor(MethodKind.PropertySet); 277private 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)
1421if (method is null || method.MethodKind != MethodKind.Constructor) 1518Debug.Assert(method?.OriginalDefinition.MethodKind != MethodKind.LocalFunction);
FlowAnalysis\DefiniteAssignment.cs (6)
102&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1258Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1311if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 2371(currentMethod.MethodKind == MethodKind.AnonymousFunction || 2372currentMethod.MethodKind == MethodKind.LocalFunction) && 2414if (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); 113Debug.Assert(method.MethodKind == MethodKind.Constructor);
FlowAnalysis\NullableWalker.cs (6)
466Debug.Assert(baseOrThisInitializer is null or { MethodKind: MethodKind.Constructor }); 1461return constructorBody is BoundConstructorMethodBody { Initializer: BoundExpressionStatement { Expression: BoundCall { Method: { MethodKind: MethodKind.Constructor } initializerMethod } } } 2132while (enclosingMemberMethod?.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 6313|| method.MethodKind != MethodKind.Ordinary 8180if (((MethodSymbol)symbol).MethodKind == MethodKind.LocalFunction)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (2)
460if (node.Method.MethodKind == MethodKind.LocalFunction) 471if (node.MethodOpt?.MethodKind == MethodKind.LocalFunction)
Lowering\ClosureConversion\ClosureConversion.cs (11)
189_seenBaseCall = method.MethodKind != MethodKind.Constructor; // only used for ctors 203(localOrParameter as MethodSymbol)?.MethodKind == MethodKind.LocalFunction); 435originalMethod.MethodKind == MethodKind.LambdaMethod && 789if (_currentMethod.MethodKind == MethodKind.Constructor && 858var loweredSymbol = (node.Method.MethodKind is MethodKind.LambdaMethod or MethodKind.LocalFunction) ? 876Debug.Assert(localFunc.MethodKind == MethodKind.LocalFunction); 1071if (node.Method.MethodKind == MethodKind.LocalFunction) 1338if (node.MethodOpt?.MethodKind == MethodKind.LocalFunction) 1364if (node.TargetMethod.MethodKind == MethodKind.LocalFunction) 1673_currentMethod.MethodKind != MethodKind.StaticConstructor &&
Lowering\DiagnosticsPass_ExpressionTrees.cs (4)
197var diagnostic = _staticLocalOrAnonymousFunction.MethodKind == MethodKind.LocalFunction 212var diagnostic = _staticLocalOrAnonymousFunction.MethodKind == MethodKind.LocalFunction 343else if (method.MethodKind == MethodKind.LocalFunction) 880if ((node.LookupSymbolOpt as MethodSymbol)?.MethodKind == MethodKind.LocalFunction)
Lowering\DiagnosticsPass_Warnings.cs (1)
368if ((object)op == null || op.MethodKind != MethodKind.UserDefinedOperator) continue;
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)
129if (targetMethod.MethodKind == MethodKind.LocalFunction) 161Debug.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)
182if (method.MethodKind is not MethodKind.Ordinary) 666var requiresInstanceReceiver = methodOrIndexer.RequiresInstanceReceiver() && methodOrIndexer is not MethodSymbol { MethodKind: MethodKind.Constructor } and not FunctionPointerMethodSymbol;
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
877if (asSpanMethod is MethodSymbol { MethodKind: MethodKind.Constructor } constructor)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
582&& _factory.TopLevelMethod.MethodKind != MethodKind.StaticConstructor // Avoid caching twice if people do it manually.
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)
41methodKind: MethodKind.Ordinary,
Lowering\SyntheticBoundNodeFactory.cs (4)
72value.MethodKind != MethodKind.AnonymousFunction && 73value.MethodKind != MethodKind.LocalFunction) 141CurrentFunction.MethodKind == MethodKind.AnonymousFunction || 142CurrentFunction.MethodKind == MethodKind.LocalFunction ||
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
109Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
SymbolDisplay\SymbolDisplayVisitor.cs (1)
381return ((IMethodSymbol)symbol).MethodKind == MethodKind.LocalFunction;
SymbolDisplay\SymbolDisplayVisitor.Members.cs (30)
272if (symbol.MethodKind == MethodKind.AnonymousFunction) 279else if (symbol.MethodKind == MethodKind.FunctionPointerSignature) 287if (symbol.MethodKind == MethodKind.ReducedExtension && Format.ExtensionMethodStyle == SymbolDisplayExtensionMethodStyle.StaticMethod) 291else if (symbol.MethodKind != MethodKind.ReducedExtension && Format.ExtensionMethodStyle == SymbolDisplayExtensionMethodStyle.InstanceMethod) 317case MethodKind.Constructor: 318case MethodKind.StaticConstructor: 320case MethodKind.Destructor: 331case MethodKind.Conversion: 378if (symbol.MethodKind == MethodKind.LocalFunction) 383else if (symbol.MethodKind == MethodKind.ReducedExtension) 415case MethodKind.Ordinary: 416case MethodKind.DelegateInvoke: 417case MethodKind.LocalFunction: 423case MethodKind.ReducedExtension: 430case MethodKind.PropertyGet: 431case MethodKind.PropertySet: 437goto case MethodKind.Ordinary; 441AddKeyword(symbol.MethodKind == MethodKind.PropertyGet ? SyntaxKind.GetKeyword : 445case MethodKind.EventAdd: 446case MethodKind.EventRemove: 452goto case MethodKind.Ordinary; 456AddKeyword(symbol.MethodKind == MethodKind.EventAdd ? SyntaxKind.AddKeyword : SyntaxKind.RemoveKeyword); 459case MethodKind.Constructor: 460case MethodKind.StaticConstructor: 474case MethodKind.Destructor: 490case MethodKind.ExplicitInterfaceImplementation: 520case MethodKind.UserDefinedOperator: 521case MethodKind.BuiltinOperator: 542case MethodKind.Conversion: 774hasThisParameter: 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)
254MethodKind targetMethodKind = MethodKind.Ordinary; 262targetMethodKind = MethodKind.Constructor; 273targetMethodKind = MethodKind.PropertyGet; 306MethodKind methodKind = method.MethodKind; 309if (methodKind == MethodKind.Conversion || methodKind == MethodKind.UserDefinedOperator) 311methodKind = MethodKind.Ordinary;
Symbols\ErrorMethodSymbol.cs (4)
199public override MethodKind MethodKind 206return MethodKind.Constructor; 209return MethodKind.Ordinary; 283Debug.Assert(MethodKind == MethodKind.Constructor);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (2)
772public override MethodKind MethodKind => MethodKind.FunctionPointerSignature;
Symbols\MemberSymbolExtensions.cs (7)
173return methodSymbol.MethodKind == MethodKind.UserDefinedOperator || methodSymbol.MethodKind == MethodKind.Conversion; 193return symbol.Kind == SymbolKind.Method && ((MethodSymbol)symbol).MethodKind == MethodKind.Conversion; 362case MethodKind.Constructor: 363case MethodKind.StaticConstructor: 375if ((object)method != null && method.MethodKind == MethodKind.Constructor) 440return method.MethodKind == MethodKind.Constructor && method.ParameterCount == 0;
Symbols\Metadata\PE\PEEventSymbol.cs (2)
125_addMethod.SetAssociatedEvent(this, MethodKind.EventAdd); 126_removeMethod.SetAssociatedEvent(this, MethodKind.EventRemove);
Symbols\Metadata\PE\PEMethodSymbol.cs (38)
114public MethodKind MethodKind 118return (MethodKind)((_bits >> MethodKindOffset) & MethodKindMask); 157Debug.Assert(EnumUtilities.ContainsAllValues<MethodKind>(MethodKindMask)); 181public void InitializeMethodKind(MethodKind methodKind) 630private bool IsDestructor => this.MethodKind == MethodKind.Destructor; 784internal bool SetAssociatedProperty(PEPropertySymbol propertySymbol, MethodKind methodKind) 786Debug.Assert((methodKind == MethodKind.PropertyGet) || (methodKind == MethodKind.PropertySet)); 794internal bool SetAssociatedEvent(PEEventSymbol eventSymbol, MethodKind methodKind) 796Debug.Assert((methodKind == MethodKind.EventAdd) || (methodKind == MethodKind.EventRemove)); 800private bool SetAssociatedPropertyOrEvent(Symbol propertyOrEventSymbol, MethodKind methodKind) 813_packedFlags.MethodKind == default(MethodKind) || 814_packedFlags.MethodKind == MethodKind.Ordinary || 815_packedFlags.MethodKind == MethodKind.ExplicitInterfaceImplementation); 975if (this.MethodKind == MethodKind.Ordinary && IsValidExtensionMethodSignature() 1003: this.MethodKind == MethodKind.Ordinary 1099public override MethodKind MethodKind 1168private MethodKind ComputeMethodKind() 1192return MethodKind.StaticConstructor; 1197return MethodKind.Constructor; 1201return MethodKind.Ordinary; 1229return IsValidUserDefinedOperatorSignature(2) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary; 1241return IsValidUserDefinedOperatorSignature(1) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary; 1245return IsValidUserDefinedOperatorSignature(1) ? MethodKind.Conversion : MethodKind.Ordinary; 1255return MethodKind.Ordinary; 1267return MethodKind.Destructor; 1273return MethodKind.DelegateInvoke; 1284return MethodKind.ExplicitInterfaceImplementation; 1287return MethodKind.Ordinary; 1321method.MethodKind == MethodKind.Destructor); 1413this.MethodKind == MethodKind.PropertySet && 1468var diag = PEUtilities.DeriveCompilerFeatureRequiredAttributeDiagnostic(this, containingModule, Handle, allowedFeatures: MethodKind == MethodKind.Constructor ? CompilerFeatureRequiredFeatures.RequiredMembers : CompilerFeatureRequiredFeatures.None, decoder); 1556Debug.Assert(MethodKind == MethodKind.Constructor); 1578var result = ObsoleteAttributeHelpers.GetObsoleteDataFromMetadata(_handle, (PEModuleSymbol)ContainingModule, ignoreByRefLikeMarker: false, ignoreRequiredMemberMarker: MethodKind == MethodKind.Constructor);
Symbols\Metadata\PE\PEParameterSymbol.cs (2)
885case "" when !ContainingSymbol.RequiresInstanceReceiver() || ContainingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.DelegateInvoke }:
Symbols\Metadata\PE\PEPropertySymbol.cs (2)
326_getMethod.SetAssociatedProperty(this, MethodKind.PropertyGet); 331_setMethod.SetAssociatedProperty(this, MethodKind.PropertySet);
Symbols\MethodSymbol.cs (31)
66public abstract MethodKind MethodKind 369protected bool IsValidReadOnlyTarget => !IsStatic && ContainingType.IsStructType() && MethodKind != MethodKind.Constructor && !IsInitOnly; 589internal bool HasSetsRequiredMembers => MethodKind == MethodKind.Constructor && HasSetsRequiredMembersImpl; 600internal static bool CanOverrideOrHide(MethodKind kind) 604case MethodKind.AnonymousFunction: 605case MethodKind.Constructor: 606case MethodKind.Destructor: 607case MethodKind.ExplicitInterfaceImplementation: 608case MethodKind.StaticConstructor: 609case MethodKind.ReducedExtension: 611case MethodKind.Conversion: 612case MethodKind.DelegateInvoke: 613case MethodKind.EventAdd: 614case MethodKind.EventRemove: 615case MethodKind.LocalFunction: 616case MethodKind.UserDefinedOperator: 617case MethodKind.Ordinary: 618case MethodKind.PropertyGet: 619case MethodKind.PropertySet: 655return MethodKind == MethodKind.Constructor && ContainingType.IsScriptClass; 671return ((MethodKind == MethodKind.Constructor || MethodKind == MethodKind.StaticConstructor) && IsImplicitlyDeclared); 682return MethodKind == MethodKind.Constructor && IsImplicitlyDeclared; 757if (!this.IsExtensionMethod || this.MethodKind == MethodKind.ReducedExtension || receiverType.IsVoidType()) 772return (this.IsExtensionMethod && this.MethodKind != MethodKind.ReducedExtension) ? ReducedExtensionMethodSymbol.Create(this) : null; 1040if (!IsStatic || IsAbstract || IsVirtual || MethodKind is not (MethodKind.Ordinary or MethodKind.LocalFunction)) 1200MethodKind is MethodKind.Ordinary 1201or MethodKind.Constructor 1202or MethodKind.UserDefinedOperator 1203or MethodKind.ReducedExtension
Symbols\MethodSymbolExtensions.cs (16)
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.UserDefinedOperator: 133case MethodKind.Conversion: 135case MethodKind.EventAdd: 136case MethodKind.EventRemove: 137case MethodKind.PropertyGet: 138case MethodKind.PropertySet: 221method.MethodKind is (MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet) &&
Symbols\NamedTypeSymbol.cs (5)
220if (candidate is MethodSymbol { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } method) 283Debug.Assert(method.MethodKind == MethodKind.Constructor); 291Debug.Assert(method.MethodKind == MethodKind.StaticConstructor); 370Debug.Assert(method.MethodKind != MethodKind.ReducedExtension);
Symbols\NativeIntegerTypeSymbol.cs (2)
96case MethodKind.Ordinary: 113case MethodKind.Constructor:
Symbols\OverriddenOrHiddenMembersHelpers.cs (2)
246bool accessorIsGetter = accessor.MethodKind == MethodKind.PropertyGet; 338bool accessorIsAdder = accessor.MethodKind == MethodKind.EventAdd;
Symbols\PublicModel\MethodSymbol.cs (35)
33MethodKind IMethodSymbol.MethodKind 39case MethodKind.AnonymousFunction: 40return MethodKind.AnonymousFunction; 41case MethodKind.Constructor: 42return MethodKind.Constructor; 43case MethodKind.Conversion: 44return MethodKind.Conversion; 45case MethodKind.DelegateInvoke: 46return MethodKind.DelegateInvoke; 47case MethodKind.Destructor: 48return MethodKind.Destructor; 49case MethodKind.EventAdd: 50return MethodKind.EventAdd; 51case MethodKind.EventRemove: 52return MethodKind.EventRemove; 53case MethodKind.ExplicitInterfaceImplementation: 54return MethodKind.ExplicitInterfaceImplementation; 55case MethodKind.UserDefinedOperator: 56return MethodKind.UserDefinedOperator; 57case MethodKind.BuiltinOperator: 58return MethodKind.BuiltinOperator; 59case MethodKind.Ordinary: 60return MethodKind.Ordinary; 61case MethodKind.PropertyGet: 62return MethodKind.PropertyGet; 63case MethodKind.PropertySet: 64return MethodKind.PropertySet; 65case MethodKind.ReducedExtension: 66return MethodKind.ReducedExtension; 67case MethodKind.StaticConstructor: 68return MethodKind.StaticConstructor; 69case MethodKind.LocalFunction: 70return MethodKind.LocalFunction; 71case MethodKind.FunctionPointerSignature: 72return MethodKind.FunctionPointerSignature;
Symbols\ReducedExtensionMethodSymbol.cs (5)
39Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 74Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 116Debug.Assert(method.MethodKind != MethodKind.ReducedExtension); 467public override MethodKind MethodKind 469get { 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)
97if (method.MethodKind != MethodKind.ExplicitInterfaceImplementation) 263(interfaceMethod.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion) != isOperator)
Symbols\Source\LambdaSymbol.cs (2)
75public override MethodKind MethodKind 77get { return MethodKind.AnonymousFunction; }
Symbols\Source\LocalFunctionSymbol.cs (2)
326public override MethodKind MethodKind => MethodKind.LocalFunction;
Symbols\Source\ParameterHelpers.cs (3)
211Debug.Assert(methodOwner?.MethodKind != MethodKind.LambdaMethod); 213methodOwner?.MethodKind == MethodKind.LocalFunction; 912if (method.MethodKind != MethodKind.AnonymousFunction)
Symbols\Source\SourceComplexParameterSymbol.cs (3)
1345if (!ContainingSymbol.RequiresInstanceReceiver() || ContainingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.DelegateInvoke or MethodKind.LambdaMethod })
Symbols\Source\SourceConstructorSymbol.cs (12)
21var methodKind = syntax.Modifiers.Any(SyntaxKind.StaticKeyword) ? MethodKind.StaticConstructor : MethodKind.Constructor; 29MethodKind methodKind, 53if (methodKind == MethodKind.Constructor && syntax.Initializer != null) 64if (methodKind == MethodKind.StaticConstructor) 83MethodKind methodKind, 123NamedTypeSymbol containingType, ConstructorDeclarationSyntax syntax, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics, 126var defaultAccess = (methodKind == MethodKind.StaticConstructor) ? DeclarationModifiers.None : DeclarationModifiers.Private; 139if (methodKind == MethodKind.StaticConstructor) 165private void CheckModifiers(MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics) 175else if (ContainingType.IsStatic && methodKind == MethodKind.Constructor)
Symbols\Source\SourceConstructorSymbolBase.cs (1)
64if (MethodKind == MethodKind.StaticConstructor && (_lazyParameters.Length != 0) &&
Symbols\Source\SourceDelegateMethodSymbol.cs (5)
26MethodKind methodKind, 217: base(delegateType, voidType, syntax, MethodKind.Constructor, RefKind.None, DeclarationModifiers.Public) 262: base(delegateType, returnType, syntax, MethodKind.DelegateInvoke, refKind, DeclarationModifiers.Virtual | DeclarationModifiers.Public) 355: base((SourceNamedTypeSymbol)invoke.ContainingType, iAsyncResultType, syntax, MethodKind.Ordinary, RefKind.None, DeclarationModifiers.Virtual | DeclarationModifiers.Public) 393: base((SourceNamedTypeSymbol)invoke.ContainingType, invoke.ReturnTypeWithAnnotations, syntax, MethodKind.Ordinary, invoke.RefKind, DeclarationModifiers.Virtual | DeclarationModifiers.Public)
Symbols\Source\SourceDestructorSymbol.cs (1)
68MethodKind.Destructor, RefKind.None, declarationModifiers, returnsVoid: true, returnsVoidIsSet: true,
Symbols\Source\SourceEventAccessorSymbol.cs (4)
36isAdder ? MethodKind.EventAdd : MethodKind.EventRemove, 118if (this.MethodKind == MethodKind.EventAdd) 127Debug.Assert(this.MethodKind == MethodKind.EventRemove);
Symbols\Source\SourceMemberContainerSymbol.cs (33)
2067if (conversion is { MethodKind: MethodKind.Conversion }) 2144if (method1.MethodKind == MethodKind.Constructor && 2160var methodKind = method1.MethodKind == MethodKind.Constructor ? MessageID.IDS_SK_CONSTRUCTOR : MessageID.IDS_SK_METHOD; 2168var methodName = (method1.MethodKind == MethodKind.Destructor && method2.MethodKind == MethodKind.Destructor) ? 2448if (member.Kind != SymbolKind.Method || ((MethodSymbol)member).MethodKind != MethodKind.Destructor) 3865if ((methodSymbol.MethodKind == MethodKind.Ordinary) && 3901if ((methodSymbol.MethodKind == MethodKind.Ordinary) && 4056case MethodKind.Constructor: 4059case MethodKind.Conversion: 4061case MethodKind.UserDefinedOperator: 4063case MethodKind.Destructor: 4066case MethodKind.ExplicitInterfaceImplementation: 4068case MethodKind.Ordinary: 4069case MethodKind.LocalFunction: 4070case MethodKind.PropertyGet: 4071case MethodKind.PropertySet: 4072case MethodKind.EventAdd: 4073case MethodKind.EventRemove: 4074case MethodKind.StaticConstructor: 4102if (m.MethodKind == MethodKind.Constructor && m.ParameterCount == 0) 4144if (hasInitializers && !builder.NonTypeMembers.Any(member => member is MethodSymbol { MethodKind: MethodKind.Constructor })) 4196case MethodSymbol { MethodKind: not (MethodKind.Ordinary or MethodKind.Constructor) }: 4287MethodKind.Ordinary, 4334MethodKind.Constructor, 4383MethodKind.Ordinary, 4443MethodKind.Ordinary, 4617MethodKind.Ordinary, 4710MethodKind.Ordinary, 4802case MethodKind.Constructor: 4812case MethodKind.StaticConstructor: 5411if (member is MethodSymbol { MethodKind: MethodKind.Ordinary })
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (2)
552else if (method.MethodKind == MethodKind.Destructor) 891!(overridingMemberIsMethod && ((MethodSymbol)overriddenMember).MethodKind == MethodKind.Destructor)) //destructors are metadata virtual
Symbols\Source\SourceMemberMethodSymbol.cs (13)
121public MethodKind MethodKind 123get { return (MethodKind)((_flags >> MethodKindOffset) & MethodKindMask); } 168Debug.Assert(EnumUtilities.ContainsAllValues<MethodKind>(MethodKindMask)); 180MethodKind methodKind, 223MethodKind methodKind, 340if (this.DeclaredAccessibility <= Accessibility.Private || MethodKind == MethodKind.ExplicitInterfaceImplementation) 345ErrorCode code = (this.MethodKind == MethodKind.Conversion || this.MethodKind == MethodKind.UserDefinedOperator) ? 356code = (this.MethodKind == MethodKind.Conversion || this.MethodKind == MethodKind.UserDefinedOperator) ? 394MethodKind methodKind, 526public sealed override MethodKind MethodKind 1098if ((!IsStatic || MethodKind is MethodKind.StaticConstructor) &&
Symbols\Source\SourceMethodSymbolWithAttributes.cs (25)
156case MethodKind.Constructor: 157case MethodKind.Destructor: 158case MethodKind.StaticConstructor: 161case MethodKind.PropertySet: 162case MethodKind.EventRemove: 163case MethodKind.EventAdd: 729else if (!this.CanBeReferencedByName || this.MethodKind == MethodKind.Destructor) 744else if (this is { MethodKind: MethodKind.LocalFunction, IsStatic: false }) 942if (MethodKind != MethodKind.Ordinary) 1040if (MethodKind != MethodKind.Ordinary) 1197if (MethodKind != MethodKind.Ordinary) 1473case MethodKind.Constructor: 1474case MethodKind.StaticConstructor: 1501var errorCode = (this.MethodKind == MethodKind.Constructor || this.MethodKind == MethodKind.StaticConstructor) ? 1553if (this.MethodKind != MethodKind.LambdaMethod) 1657case MethodKind.Constructor: 1658case MethodKind.StaticConstructor: 1659case MethodKind.PropertyGet: 1660case MethodKind.PropertySet: 1661case MethodKind.EventAdd: 1662case MethodKind.EventRemove: 1663case MethodKind.UserDefinedOperator: 1664case MethodKind.Conversion: 1737if (this.ContainingType.IsComImport && this.MethodKind == MethodKind.Constructor)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1800&& !GetMembers().All(m => m is not MethodSymbol { MethodKind: MethodKind.Constructor, ObsoleteKind: ObsoleteAttributeKind.None } method
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (3)
61if (MethodKind == MethodKind.ExplicitInterfaceImplementation) 92if (MethodKind != MethodKind.ExplicitInterfaceImplementation) 198return MethodKind == MethodKind.ExplicitInterfaceImplementation;
Symbols\Source\SourceOrdinaryMethodSymbol.cs (16)
36var methodKind = interfaceSpecifier == null 37? MethodKind.Ordinary 38: MethodKind.ExplicitInterfaceImplementation; 52MethodKind methodKind, 76ModifierUtils.CheckAccessibility(this.DeclarationModifiers, this, isExplicitInterfaceImplementation: methodKind == MethodKind.ExplicitInterfaceImplementation, diagnostics, location); 90NamedTypeSymbol containingType, Location location, MethodDeclarationSyntax syntax, MethodKind methodKind, 105isExplicitInterfaceImplementation: methodKind == MethodKind.ExplicitInterfaceImplementation, 635Debug.Assert(this.MethodKind != MethodKind.UserDefinedOperator, "SourceUserDefinedOperatorSymbolBase overrides this"); 680CheckModifiers(MethodKind == MethodKind.ExplicitInterfaceImplementation, _location, diagnostics); 687private static (DeclarationModifiers mods, bool hasExplicitAccessMod) MakeModifiers(MethodDeclarationSyntax syntax, NamedTypeSymbol containingType, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics) 690bool isExplicitInterfaceImplementation = methodKind == MethodKind.ExplicitInterfaceImplementation; 768private static DeclarationModifiers AddImpliedModifiers(DeclarationModifiers mods, bool containingTypeIsInterface, MethodKind methodKind, bool hasBody) 775methodKind == MethodKind.ExplicitInterfaceImplementation); 777else if (methodKind == MethodKind.ExplicitInterfaceImplementation) 922MethodKind methodKind, 980MethodKind methodKind,
Symbols\Source\SourcePropertyAccessorSymbol.cs (19)
41var methodKind = isGetMethod ? MethodKind.PropertyGet : MethodKind.PropertySet; 94var methodKind = isGetMethod ? MethodKind.PropertyGet : MethodKind.PropertySet; 156methodKind: MethodKind.PropertyGet, 183MethodKind methodKind, 224bool hasBlockBody, bool hasExpressionBody, SyntaxTokenList modifiers, MethodKind methodKind, bool isNullableAnalysisEnabled, 358if (MethodKind == MethodKind.PropertySet) 380if (this.MethodKind == MethodKind.PropertyGet) 484MethodKind == MethodKind.PropertyGet; 562else if (LocalDeclaredReadOnly && _isAutoPropertyAccessor && MethodKind == MethodKind.PropertySet) 617MethodSymbol implementedAccessor = this.MethodKind == MethodKind.PropertyGet 646Debug.Assert(MethodKind == MethodKind.PropertySet); 677bool isGetMethod = this.MethodKind == MethodKind.PropertyGet; 761bool isGetMethod = this.MethodKind == MethodKind.PropertyGet; 835? (MethodKind == MethodKind.PropertyGet ? other.GetMethod : other.SetMethod) 839? (MethodKind == MethodKind.PropertyGet ? other.GetMethod : other.SetMethod)
Symbols\Source\SourcePropertySymbolBase.cs (4)
346{ MethodKind: MethodKind.PropertyGet, IsInitOnly: false } => SyntaxFacts.GetText(SyntaxKind.GetKeyword), 347{ MethodKind: MethodKind.PropertySet, IsInitOnly: false } => SyntaxFacts.GetText(SyntaxKind.SetKeyword), 348{ MethodKind: MethodKind.PropertySet, IsInitOnly: true } => SyntaxFacts.GetText(SyntaxKind.InitKeyword), 1181Debug.Assert(thisAccessor.MethodKind == MethodKind.PropertySet);
Symbols\Source\SourceUserDefinedConversionSymbol.cs (4)
42var methodKind = interfaceSpecifier == null 43? MethodKind.Conversion 44: MethodKind.ExplicitInterfaceImplementation; 54MethodKind methodKind,
Symbols\Source\SourceUserDefinedOperatorSymbol.cs (4)
47var methodKind = interfaceSpecifier == null 48? MethodKind.UserDefinedOperator 49: MethodKind.ExplicitInterfaceImplementation; 59MethodKind methodKind,
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (5)
25MethodKind methodKind, 47isExplicitInterfaceImplementation: methodKind == MethodKind.ExplicitInterfaceImplementation, 125protected static DeclarationModifiers MakeDeclarationModifiers(MethodKind methodKind, bool inInterface, BaseMethodDeclarationSyntax syntax, Location location, BindingDiagnosticBag diagnostics) 127bool isExplicitInterfaceImplementation = methodKind == MethodKind.ExplicitInterfaceImplementation; 344if (MethodKind == MethodKind.ExplicitInterfaceImplementation)
Symbols\Source\ThisParameterSymbol.cs (1)
152if (_containingMethod?.MethodKind == MethodKind.Constructor)
Symbols\Symbol.cs (14)
669case MethodKind.Ordinary: 670case MethodKind.LocalFunction: 671case MethodKind.ReducedExtension: 673case MethodKind.Destructor: 678case MethodKind.DelegateInvoke: 680case MethodKind.PropertyGet: 681case MethodKind.PropertySet: 730case MethodKind.Ordinary: 731case MethodKind.LocalFunction: 732case MethodKind.DelegateInvoke: 733case MethodKind.Destructor: // See comment in CanBeReferencedByName. 735case MethodKind.PropertyGet: 736case MethodKind.PropertySet: 1238this is MethodSymbol method && method.MethodKind == MethodKind.FunctionPointerSignature ?
Symbols\Symbol_Attributes.cs (4)
58case MethodKind.Constructor: 59case MethodKind.StaticConstructor: 673Debug.Assert(!binder.InAttributeArgument || this is MethodSymbol { MethodKind: MethodKind.LambdaMethod or MethodKind.LocalFunction }, "Possible cycle in attribute binding");
Symbols\SymbolExtensions.cs (5)
150if (method.MethodKind != MethodKind.AnonymousFunction && method.MethodKind != MethodKind.LocalFunction) break; 170if (method.MethodKind == MethodKind.AnonymousFunction || method.MethodKind == MethodKind.LocalFunction) 828=> method is { MethodKind: MethodKind.Constructor, HasSetsRequiredMembers: false };
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
42MethodKind.Constructor,
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (1)
135if (member is MethodSymbol { ContainingType.IsRecord: true, MethodKind: MethodKind.Constructor } method)
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (1)
150MethodKind.PropertyGet,
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (1)
39: base(MethodKind.UserDefinedOperator, explicitInterfaceType: null, name, containingType, containingType.GetFirstLocation(), (CSharpSyntaxNode)containingType.SyntaxReferences[0].GetSyntax(),
Symbols\Synthesized\Records\SynthesizedRecordOrdinaryMethod.cs (1)
27MethodKind.Ordinary, RefKind.None, declarationModifiers, returnsVoid: false, returnsVoidIsSet: false,
Symbols\Synthesized\SynthesizedAccessorValueParameterSymbol.cs (1)
128if (accessor.MethodKind == MethodKind.EventAdd)
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (2)
93public override MethodKind MethodKind 95get { return MethodKind.DelegateInvoke; }
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
151public override MethodKind MethodKind 153get { return MethodKind.Ordinary; }
Symbols\Synthesized\SynthesizedEventAccessorSymbol.cs (2)
53return this.MethodKind == MethodKind.EventAdd 130BoundBlock 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)
244public override MethodKind MethodKind 246get { 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)
66public override MethodKind MethodKind 70return MethodKind.BuiltinOperator;
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (1)
133public override MethodKind MethodKind
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
72MethodKind.Ordinary,
Symbols\Synthesized\SynthesizedStaticConstructor.cs (2)
189public override MethodKind MethodKind 193return MethodKind.StaticConstructor;
Symbols\TypeMap.cs (2)
193stopAt?.MethodKind == MethodKind.StaticConstructor || 194stopAt?.MethodKind == MethodKind.Constructor);
Symbols\TypeSymbol.cs (9)
1563case MethodKind.PropertyGet: 1566case MethodKind.PropertySet: 1569case MethodKind.EventAdd: 1572case MethodKind.EventRemove: 1696else if (implicitImplMethod.IsStatic && implicitImplMethod.MethodKind == MethodKind.Ordinary && implicitImplMethod.GetUnmanagedCallersOnlyAttributeData(forceComplete: true) is not null) 2173isOperator = interfaceMethod.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion; 2181(((MethodSymbol)member).MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion) != isOperator.GetValueOrDefault())
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
280public override MethodKind MethodKind
Microsoft.CodeAnalysis.CSharp.CodeStyle (19)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
88if (context.OwningSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor })
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (4)
176if (owningMethod.MethodKind is not (MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet)
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
65MethodKind: MethodKind.Constructor,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
79if (method.MethodKind == MethodKind.PropertyGet) 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (3)
70method.MethodKind is MethodKind.PropertyGet or MethodKind.Ordinary && 143=> method.MethodKind != MethodKind.Ordinary
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
19conversion.MethodSymbol.MethodKind == MethodKind.Conversion &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
372MethodKind: MethodKind.ReducedExtension,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
67if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
921if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1166method.MethodKind is not (MethodKind.LocalFunction or MethodKind.LambdaMethod) && 1336if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1337rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
215methodKind: MethodKind.Conversion);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
156if (method.MethodKind == MethodKind.Conversion) 162if (method.MethodKind == MethodKind.UserDefinedOperator)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
2017while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (2)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (2)
242[InlineData("void [|m|]() {}", "void M() {}", MethodKind.Ordinary, Accessibility.Private)] 243[InlineData("void Outer() { void [|m|]() {} }", "void Outer() { void M() {} }", MethodKind.LocalFunction, Accessibility.NotApplicable)]
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupSessionManager_EventHookupSession.cs (1)
176new SymbolKindOrTypeKind(MethodKind.Ordinary),
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (40)
Completion\CompletionProviders\DeclarationNameCompletionProviderTests.cs (2)
2956SpecificationStyle(new SymbolKindOrTypeKind(MethodKind.Ordinary), "Method"), 2958SpecificationStyle(new SymbolKindOrTypeKind(MethodKind.LocalFunction), "LocalFunction"),
Completion\CompletionProviders\DeclarationNameCompletionProviderTests_NameDeclarationInfoTests.cs (22)
38new SymbolKindOrTypeKind(MethodKind.Ordinary)); 56new SymbolKindOrTypeKind(MethodKind.Ordinary)); 73new SymbolKindOrTypeKind(MethodKind.Ordinary)); 91new SymbolKindOrTypeKind(MethodKind.Ordinary)); 127new SymbolKindOrTypeKind(MethodKind.LocalFunction)); 166new SymbolKindOrTypeKind(MethodKind.LocalFunction)); 433new SymbolKindOrTypeKind(MethodKind.Ordinary)); 447new SymbolKindOrTypeKind(MethodKind.Ordinary)); 461new SymbolKindOrTypeKind(MethodKind.Ordinary)); 475new SymbolKindOrTypeKind(MethodKind.Ordinary)); 488new SymbolKindOrTypeKind(MethodKind.Ordinary)); 504new SymbolKindOrTypeKind(MethodKind.Ordinary)); 589new SymbolKindOrTypeKind(MethodKind.LocalFunction)); 609new SymbolKindOrTypeKind(MethodKind.LocalFunction)); 631new SymbolKindOrTypeKind(MethodKind.LocalFunction)); 651new SymbolKindOrTypeKind(MethodKind.LocalFunction)); 671new SymbolKindOrTypeKind(MethodKind.LocalFunction)); 693new SymbolKindOrTypeKind(MethodKind.LocalFunction)); 713new SymbolKindOrTypeKind(MethodKind.LocalFunction)); 733new SymbolKindOrTypeKind(MethodKind.LocalFunction)); 753new SymbolKindOrTypeKind(MethodKind.LocalFunction)); 772new SymbolKindOrTypeKind(MethodKind.LocalFunction));
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (4)
96Assert.False(ideEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.MethodKind == MethodKind.DelegateInvoke && e.ReturnsVoid)); 97Assert.False(ideEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.MethodKind == MethodKind.DelegateInvoke && !e.ReturnsVoid)); 109Assert.False(compilerEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.MethodKind == MethodKind.DelegateInvoke && e.ReturnsVoid)); 110Assert.False(compilerEngineAnalyzer.CallLog.Any(e => e.CallerName == method && e.MethodKind == MethodKind.DelegateInvoke && !e.ReturnsVoid));
Diagnostics\NamingStyles\EditorConfigNamingStyleParserTests.cs (12)
49new SymbolKindOrTypeKind(MethodKind.Ordinary), 119new SymbolKindOrTypeKind(MethodKind.Ordinary), 120new SymbolKindOrTypeKind(MethodKind.LocalFunction) 178new SymbolKindOrTypeKind(MethodKind.Ordinary), 226new SymbolKindOrTypeKind(MethodKind.Ordinary), 310var expectedApplicableSymbolKindList = new[] { new SymbolKindOrTypeKind(MethodKind.LocalFunction) }; 340[InlineData("property,method", new object[] { SymbolKind.Property, MethodKind.Ordinary })] 344[InlineData("*", new object[] { SymbolKind.Namespace, TypeKind.Class, TypeKind.Struct, TypeKind.Interface, TypeKind.Enum, SymbolKind.Property, MethodKind.Ordinary, MethodKind.LocalFunction, SymbolKind.Field, SymbolKind.Event, TypeKind.Delegate, SymbolKind.Parameter, SymbolKind.TypeParameter, SymbolKind.Local })] 345[InlineData(null, new object[] { SymbolKind.Namespace, TypeKind.Class, TypeKind.Struct, TypeKind.Interface, TypeKind.Enum, SymbolKind.Property, MethodKind.Ordinary, MethodKind.LocalFunction, SymbolKind.Field, SymbolKind.Event, TypeKind.Delegate, SymbolKind.Parameter, SymbolKind.TypeParameter, SymbolKind.Local })] 346[InlineData("property,method,invalid", new object[] { SymbolKind.Property, MethodKind.Ordinary })]
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (13)
BreakingChanges.cs (2)
128Assert.Equal(MethodKind.PropertySet, derivedProperty1Synthesized.MethodKind); 131Assert.Equal(MethodKind.PropertyGet, derivedProperty2Synthesized.MethodKind);
CodeGen\CodeGenTupleTest.cs (1)
14341Assert.Equal(MethodKind.ReducedExtension, m6Method.MethodKind);
CodeGen\DestructorTests.cs (1)
824Assert.Equal(MethodKind.Destructor, destructor.MethodKind);
CodeGen\EventTests.cs (2)
216Assert.Equal(MethodKind.EventAdd, addMethod.MethodKind); 222Assert.Equal(MethodKind.EventRemove, removeMethod.MethodKind);
CodeGen\IndexerTests.cs (4)
162Assert.Equal(MethodKind.ExplicitInterfaceImplementation, getMethod.MethodKind); //since CallMethodsDirectly 167Assert.Equal(MethodKind.ExplicitInterfaceImplementation, setMethod.MethodKind); //since CallMethodsDirectly 270Assert.Equal(MethodKind.PropertyGet, getMethod.MethodKind); 282Assert.Equal(MethodKind.PropertySet, setMethod.MethodKind);
Emit\CompilationEmitTests.cs (1)
2732var cciMethods = class1TypeDef.GetMethods(context).Where(m => ((MethodSymbol)m.GetInternalSymbol()).MethodKind != MethodKind.Constructor);
Emit\EmitMetadataTests.cs (2)
602Assert.Equal(MethodKind.Constructor, ctor.MethodKind); 623Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (16)
Emit\EditAndContinue\SymbolMatcherTests.cs (16)
1719var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1720var members0 = compilation0.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1761var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1762var members0 = compilation0.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1813var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1814var members0 = compilation0.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1860var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1905var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (6)
Attributes\AttributeTests_CallerInfoAttributes.cs (2)
4405Assert.Equal(MethodKind.Constructor, ctor.MethodKind); 4435Assert.Equal(MethodKind.Constructor, ctor.MethodKind);
Semantics\ParamsCollectionTests.cs (1)
8885bool hasBody = p.ContainingSymbol is not MethodSymbol { MethodKind: MethodKind.DelegateInvoke };
Semantics\PrimaryConstructorTests.cs (2)
134Assert.Equal(MethodKind.Constructor, members.Cast<MethodSymbol>().Single().MethodKind); 821Assert.All(c.GetMembers(), m => Assert.True(m is MethodSymbol { MethodKind: MethodKind.Constructor }));
Semantics\RecordTests.cs (1)
22526var ordinaryMethods = comp.GetMember<NamedTypeSymbol>("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind == MethodKind.Ordinary).ToArray();
Microsoft.CodeAnalysis.CSharp.Features (45)
ChangeSignature\CSharpChangeSignatureService.cs (1)
426symbolInfo.Symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension },
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (4)
175_ => [new SymbolKindOrTypeKind(SymbolKind.Local), new SymbolKindOrTypeKind(MethodKind.LocalFunction)], 517new SymbolKindOrTypeKind(MethodKind.Ordinary)); 540? [new SymbolKindOrTypeKind(MethodKind.LocalFunction)] : 541[new SymbolKindOrTypeKind(SymbolKind.Local), new SymbolKindOrTypeKind(MethodKind.LocalFunction)];
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.CompletionSymbolDisplay.cs (4)
57case MethodKind.Ordinary: 60case MethodKind.UserDefinedOperator: 61case MethodKind.BuiltinOperator: 65case MethodKind.Conversion:
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (13)
947if (symbol is not IMethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor } method) 1984MethodKind.PropertyGet => symbol.AssociatedSymbol is IPropertySymbol { IsIndexer: true } ? CSharpFeaturesResources.indexer_getter : CSharpFeaturesResources.property_getter, 1985MethodKind.PropertySet => symbol.AssociatedSymbol is IPropertySymbol { IsIndexer: true } ? CSharpFeaturesResources.indexer_setter : CSharpFeaturesResources.property_setter, 1986MethodKind.StaticConstructor => FeaturesResources.static_constructor, 1987MethodKind.Destructor => CSharpFeaturesResources.destructor, 1988MethodKind.Conversion => CSharpFeaturesResources.conversion_operator, 1989MethodKind.LocalFunction => FeaturesResources.local_function, 1990MethodKind.LambdaMethod => CSharpFeaturesResources.lambda, 1991MethodKind.Ordinary when symbol.Name == WellKnownMemberNames.TopLevelStatementsEntryPointMethodName => CSharpFeaturesResources.top_level_code, 2537IMethodSymbol { MethodKind: MethodKind.Destructor } 2541IMethodSymbol { MethodKind: MethodKind.Conversion or MethodKind.UserDefinedOperator }
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (4)
111methodKind: this.LocalFunction ? MethodKind.LocalFunction : MethodKind.Ordinary); 810var localFunctionPreferences = Options.NamingStyle.SymbolSpecifications.Where(symbol => symbol.AppliesTo(new SymbolSpecification.SymbolKindOrTypeKind(MethodKind.LocalFunction), CreateMethodModifiers(), null)); 813var localFunctionKind = new SymbolSpecification.SymbolKindOrTypeKind(MethodKind.LocalFunction);
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
59if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
InlineHints\CSharpInlineTypeHintsService.cs (1)
82if (parameter?.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction } &&
NavigationBar\CSharpNavigationBarItemService.cs (2)
185return method.MethodKind is MethodKind.PropertyGet or MethodKind.PropertySet;
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_DelegateAndFunctionPointerInvoke.cs (1)
64if (invokeMethod.MethodKind == MethodKind.FunctionPointerSignature)
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
75methodGroup = methodGroup.Where(m => m.IsStatic || m is IMethodSymbol { MethodKind: MethodKind.LocalFunction });
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
88if (context.OwningSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor })
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (4)
176if (owningMethod.MethodKind is not (MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet)
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
65MethodKind: MethodKind.Constructor,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
79if (method.MethodKind == MethodKind.PropertyGet) 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (3)
70method.MethodKind is MethodKind.PropertyGet or MethodKind.Ordinary && 143=> method.MethodKind != MethodKind.Ordinary
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
215methodKind: MethodKind.Conversion);
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
109Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (2)
242[InlineData("void [|m|]() {}", "void M() {}", MethodKind.Ordinary, Accessibility.Private)] 243[InlineData("void Outer() { void [|m|]() {} }", "void Outer() { void M() {} }", MethodKind.LocalFunction, Accessibility.NotApplicable)]
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (35)
Semantics\DelegateTypeTests.cs (3)
902Assert.Equal(MethodKind.LambdaMethod, method.MethodKind); 945Assert.Equal(MethodKind.LambdaMethod, method.MethodKind); 8058Assert.Equal(MethodKind.LambdaMethod, method.MethodKind);
Semantics\InitOnlyMemberTests.cs (1)
2565bool isSetter = method.MethodKind == MethodKind.PropertySet;
Semantics\LambdaTests.cs (5)
858Assert.Equal(MethodKind.AnonymousFunction, (sym as IMethodSymbol).MethodKind); 868Assert.Equal(MethodKind.AnonymousFunction, (sym as IMethodSymbol).MethodKind); 3044Assert.Equal(MethodKind.AnonymousFunction, lambda.MethodKind); 3051Assert.Equal(MethodKind.AnonymousFunction, lambda.MethodKind); 5643Assert.Equal(MethodKind.LambdaMethod, method.MethodKind);
Semantics\LocalFunctionTests.cs (1)
1063Assert.Equal(MethodKind.Constructor, attrConstructor.MethodKind);
Semantics\NamedAndOptionalTests.cs (5)
2047var methods = module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind == MethodKind.Ordinary).ToArray(); 2129var methods = module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind == MethodKind.Ordinary).ToArray(); 2180var methods = module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind == MethodKind.Ordinary).ToArray(); 2263var methods = module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind == MethodKind.Ordinary).ToArray(); 2345var methods = module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind == MethodKind.Ordinary).ToArray();
Semantics\NativeIntegerTests.cs (8)
327case MethodKind.Ordinary: 329case MethodKind.PropertyGet: 330case MethodKind.PropertySet: 345return !(nativeIntegerMember is IMethodSymbol { MethodKind: MethodKind.Constructor }); 441case MethodKind.Ordinary: 443case MethodKind.PropertyGet: 444case MethodKind.PropertySet: 459return !(nativeIntegerMember is MethodSymbol { MethodKind: MethodKind.Constructor });
Semantics\OperatorTests.cs (4)
7618Assert.Equal(MethodKind.BuiltinOperator, symbol1.MethodKind); 8103Assert.Equal(MethodKind.UserDefinedOperator, s.MethodKind); 8291Assert.Equal(MethodKind.UserDefinedOperator, symbol1.MethodKind); 8394Assert.Equal(MethodKind.BuiltinOperator, symbol1.MethodKind);
Semantics\QueryTests.cs (4)
1462Assert.NotEqual(MethodKind.ReducedExtension, ((IMethodSymbol)info0.CastInfo.Symbol).MethodKind); 1471Assert.NotEqual(MethodKind.ReducedExtension, ((IMethodSymbol)info1.OperationInfo.Symbol).MethodKind); 1671Assert.Equal(MethodKind.ReducedExtension, ((IMethodSymbol)info0.CastInfo.Symbol).MethodKind); 1680Assert.Equal(MethodKind.ReducedExtension, ((IMethodSymbol)info1.OperationInfo.Symbol).MethodKind);
Semantics\TopLevelStatementsTests.cs (1)
4221Assert.Equal(MethodKind.LocalFunction, ((IMethodSymbol)local).MethodKind);
Semantics\UnsafeTests.cs (2)
8873Assert.Equal(MethodKind.BuiltinOperator, summaryMethod.MethodKind); 9335Assert.Equal(MethodKind.BuiltinOperator, summaryMethod.MethodKind);
Semantics\Utf8StringsLiteralsTests.cs (1)
4086Assert.Equal(MethodKind.BuiltinOperator, method.MethodKind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (401)
Compilation\GetSemanticInfoTests.cs (7)
1074Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)baseConstructor).MethodKind); 1093Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)baseConstructor).MethodKind); 1116Assert.Equal(MethodKind.Constructor, invokedConstructor.MethodKind); 1172Assert.Equal(MethodKind.EventAdd, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 1201Assert.Equal(MethodKind.EventRemove, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 2360Assert.Equal(MethodKind.AnonymousFunction, ((IMethodSymbol)parameterSymbol.ContainingSymbol).MethodKind); 2542Assert.Equal(MethodKind.Conversion, ((IMethodSymbol)symbol.ContainingSymbol).MethodKind);
Compilation\SemanticModelAPITests.cs (3)
1371Assert.Equal(MethodKind.Constructor, method.MethodKind); 2087Assert.Equal(MethodKind.Constructor, method.MethodKind); 2104Assert.Equal(MethodKind.Constructor, method.MethodKind);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (10)
354Assert.Equal(MethodKind.PropertyGet, getterSymbol.MethodKind); 360Assert.Equal(MethodKind.PropertySet, setterSymbol.MethodKind); 1722symbol.Kind == SymbolKind.Method && (((IMethodSymbol)symbol).IsExtensionMethod || ((IMethodSymbol)symbol).MethodKind == MethodKind.ReducedExtension); 1885symbol.Kind == SymbolKind.Method && (((IMethodSymbol)symbol).IsExtensionMethod || ((IMethodSymbol)symbol).MethodKind == MethodKind.ReducedExtension); 2854Assert.Equal(MethodKind.ExplicitInterfaceImplementation, explicitMethodSymbol.MethodKind); 2874Assert.Equal(MethodKind.PropertyGet, explicitPropertyGetterSymbol.MethodKind); 2884Assert.Equal(MethodKind.PropertySet, explicitPropertySetterSymbol.MethodKind); 4435Assert.Equal(MethodKind.Conversion, conversion.MethodKind); 4466Assert.Equal(MethodKind.Conversion, conversion.MethodKind); 4497Assert.Equal(MethodKind.UserDefinedOperator, @operator.MethodKind);
Compilation\SemanticModelGetSemanticInfoTests.cs (5)
4886Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol.ContainingSymbol).MethodKind); 4893Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol.ContainingSymbol).MethodKind); 5413Assert.Equal(MethodKind.PropertySet, ((IMethodSymbol)sortedCandidates[0]).MethodKind); 6373Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)symbol).MethodKind); 7295Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)semanticInfo.Symbol).MethodKind);
DocumentationComments\CrefTests.cs (5)
3230Assert.Equal(MethodKind.Ordinary, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 3278Assert.Equal(MethodKind.Conversion, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 3302Assert.Equal(MethodKind.UserDefinedOperator, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 3326Assert.Equal(MethodKind.Constructor, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind); 5718Assert.Equal(MethodKind.UserDefinedOperator, ((IMethodSymbol)symbol).MethodKind);
DocumentationComments\DocumentationCommentIDTests.cs (1)
351var method = type.GetMembersUnordered().OfType<MethodSymbol>().Single(m => m.MethodKind == MethodKind.ExplicitInterfaceImplementation);
SymbolDisplay\SymbolDisplayTests.cs (4)
6442Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind); 6485Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind); 6520Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind); 6614Assert.Equal(MethodKind.LocalFunction, localSymbol.MethodKind);
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (4)
433Assert.Equal(MethodKind.Ordinary, derivedMethod.MethodKind); 483Assert.Equal(MethodKind.PropertyGet, derivedGetter.MethodKind); 883if (m.MethodKind == MethodKind.Constructor) 887Assert.NotEqual(MethodKind.Ordinary, m.MethodKind);
Symbols\CheckedUserDefinedOperatorsTests.cs (103)
51var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 53Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 84var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 87Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 88Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 118var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 120Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 121Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 165var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 168Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 169Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 356var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 381var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 457var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 484var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 515var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 533expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 541expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 687var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 705expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 713expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 810var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 818expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 826expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 859var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 867expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 875expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 904var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 906Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 938var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 942Assert.Equal(MethodKind.UserDefinedOperator, opSymbol1.MethodKind); 948Assert.Equal(MethodKind.UserDefinedOperator, opSymbol2.MethodKind); 981var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 984Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 985Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 1017var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1020Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 1023Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 1026Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[2].MethodKind); 1268var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1270Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 1302var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1305Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 1306Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 1337var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1339Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 1340Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 1371var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1374Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 1375Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 1526var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1553var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1635var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1662var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1695var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1714expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1722expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1818var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1836expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1851expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1884var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1892expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1900expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1928var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1946expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1954expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2053var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2071expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2079expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2112var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2120expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2128expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2181var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2183Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 2226var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2229Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 2230Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 2441var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2468var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2502var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2504Assert.Equal(MethodKind.Conversion, opSymbol.MethodKind); 2538var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2541Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 2542Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind); 2578var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2580Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 2581Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind); 2617var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2620Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 2621Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind); 2758var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2781var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2854var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2872expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2880expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 3020var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3038expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3046expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3188var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3190Assert.Equal(MethodKind.Conversion, opSymbol.MethodKind); 3220var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 3223Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 3224Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind);
Symbols\ConversionTests.cs (3)
1722var conversionSymbols = destinationType.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Conversion); 1803Assert.Equal(MethodKind.Conversion, method.MethodKind); 1837Assert.Equal(MethodKind.Conversion, method.MethodKind);
Symbols\DefaultInterfaceImplementationTests.cs (5)
43953Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 44670Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 44768Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 45236Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 45704Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind);
Symbols\DestructorTests.cs (1)
401Assert.Equal(MethodKind.Destructor, destructor.MethodKind);
Symbols\ExtensionMethodTests.cs (2)
229Assert.Equal(MethodKind.ReducedExtension, gooSymbol.MethodKind); 232Assert.Equal(MethodKind.Ordinary, gooOriginal.MethodKind);
Symbols\InterfaceImplementationTests.cs (25)
131Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classExplicitImplementationBase.MethodKind); 134Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classExplicitImplementation.MethodKind); 137Assert.Equal(MethodKind.Ordinary, classImplicitImplementation.MethodKind); 257Assert.Equal(MethodKind.Ordinary, classImplicitImplementation.MethodKind); 260Assert.Equal(MethodKind.Ordinary, classImplicitImplementationBase.MethodKind); 440Assert.Equal(MethodKind.ExplicitInterfaceImplementation, baseClassExplicitImplementationBase.MethodKind); 443Assert.Equal(MethodKind.ExplicitInterfaceImplementation, baseClassExplicitImplementation.MethodKind); 446Assert.Equal(MethodKind.Ordinary, baseClassImplicitImplementation.MethodKind); 519Assert.Equal(MethodKind.Ordinary, baseClassImplicitImplementation.MethodKind); 522Assert.Equal(MethodKind.Ordinary, baseClassImplicitImplementationBase.MethodKind); 582Assert.Equal(MethodKind.Ordinary, baseClassMethod.MethodKind); 681Assert.Equal(MethodKind.ExplicitInterfaceImplementation, baseClassMethod.MethodKind); 688Assert.Equal(MethodKind.Ordinary, class1Method.MethodKind); 696Assert.Equal(MethodKind.Ordinary, class2Method.MethodKind); 744Assert.Equal(MethodKind.Ordinary, baseClassMethodVirtual.MethodKind); 748Assert.Equal(MethodKind.Ordinary, baseClassMethodNonVirtual.MethodKind); 760Assert.Equal(MethodKind.Ordinary, class1MethodVirtual.MethodKind); 764Assert.Equal(MethodKind.Ordinary, class1MethodNonVirtual.MethodKind); 778Assert.Equal(MethodKind.Ordinary, class2MethodVirtual.MethodKind); 782Assert.Equal(MethodKind.Ordinary, class2MethodNonVirtual.MethodKind); 1022Assert.Equal(MethodKind.PropertyGet, synthesizedExplicitImpls[1].MethodKind); 1026Assert.Equal(MethodKind.PropertySet, synthesizedExplicitImpls[2].MethodKind); 2220Where(m => m.MethodKind == MethodKind.ExplicitInterfaceImplementation). 2221Single(m => m.ExplicitInterfaceImplementations.Single().MethodKind == MethodKind.EventAdd); 2296Single(m => m.MethodKind == MethodKind.ExplicitInterfaceImplementation);
Symbols\Metadata\MetadataMemberTests.cs (2)
164Assert.Equal(MethodKind.Constructor, ctor.MethodKind); 205Assert.Equal(MethodKind.Ordinary, member1.MethodKind);
Symbols\Metadata\PE\LoadingEvents.cs (2)
98case MethodKind.EventAdd: 101case MethodKind.EventRemove:
Symbols\Metadata\PE\LoadingIndexers.cs (5)
1072Assert.Equal(MethodKind.Ordinary, accessor.MethodKind); 1077Assert.Equal(propertyIsIndexer ? MethodKind.PropertyGet : MethodKind.Ordinary, accessor.MethodKind); 1084Assert.Equal(propertyIsIndexer ? MethodKind.PropertySet : MethodKind.Ordinary, accessor.MethodKind);
Symbols\Metadata\PE\LoadingMethods.cs (21)
398Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 428Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); // because it has name without '.' 466Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 502Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 530Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); // because it has name without '.' 553Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); 593Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 619Assert.Equal(MethodKind.Ordinary, derivedClassMethod.MethodKind); 644Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); 648Assert.Equal(MethodKind.Ordinary, classGenericMethod.MethodKind); 677Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind); 681Assert.Equal(MethodKind.Ordinary, classGenericMethod.MethodKind); 1182Assert.Equal(m.Name == ".cctor" ? MethodKind.StaticConstructor : MethodKind.Constructor, ((MethodSymbol)m).MethodKind); 1187Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); 1192Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); 1197Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); 1202Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); 1207Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); 1212Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind); 1217Assert.Equal(MethodKind.Ordinary, ((MethodSymbol)m).MethodKind);
Symbols\ModuleInitializers\ModuleInitializersTests.cs (1)
133Assert.Equal(MethodKind.StaticConstructor, staticConstructor.MethodKind);
Symbols\RequiredMembersTests.cs (1)
70foreach (var ctor in type.GetMembers().Where(m => m is MethodSymbol { MethodKind: MethodKind.Constructor }))
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (5)
87if (method.MethodKind == MethodKind.ExplicitInterfaceImplementation) 157Assert.Equal(MethodKind.ExplicitInterfaceImplementation, retargetedClassCMethod1.MethodKind); 168Assert.Equal(MethodKind.ExplicitInterfaceImplementation, retargetedClassCMethod2.MethodKind); 177Assert.Equal(MethodKind.ExplicitInterfaceImplementation, retargetedClassCMethod3.MethodKind); 186Assert.Equal(MethodKind.ExplicitInterfaceImplementation, retargetedClassCMethod4.MethodKind);
Symbols\Source\CustomModifierCopyTests.cs (5)
533AssertAllParametersHaveConstModOpt(explicitImpl, ignoreLast: explicitImpl.MethodKind == MethodKind.PropertySet); 738var explicitGetterImpl = explicitImpls.Where(impl => impl.ImplementingMethod.MethodKind == MethodKind.PropertyGet).Single(); 741var explicitSetterImpl = explicitImpls.Where(impl => impl.ImplementingMethod.MethodKind == MethodKind.PropertySet).Single(); 1486m => m.MethodKind == MethodKind.ExplicitInterfaceImplementation); 1530m => m.MethodKind == MethodKind.ExplicitInterfaceImplementation);
Symbols\Source\DeclaringSyntaxNodeTests.cs (2)
159Assert.Equal(MethodKind.AnonymousFunction, sym.MethodKind); 523if (memb.Kind == SymbolKind.Method && ((IMethodSymbol)memb).MethodKind == MethodKind.Constructor)
Symbols\Source\DelegateTests.cs (1)
112Assert.Equal(MethodKind.DelegateInvoke, invoke.MethodKind);
Symbols\Source\EventTests.cs (8)
89Assert.Equal(MethodKind.EventAdd, addMethod.MethodKind); 94Assert.Equal(MethodKind.EventRemove, removeMethod.MethodKind); 127Assert.Equal(MethodKind.EventAdd, addMethod.MethodKind); 132Assert.Equal(MethodKind.EventRemove, removeMethod.MethodKind); 166Assert.Equal(MethodKind.EventAdd, addMethod.MethodKind); 171Assert.Equal(MethodKind.EventRemove, removeMethod.MethodKind); 201Assert.Equal(MethodKind.EventAdd, addMethod.MethodKind); 206Assert.Equal(MethodKind.EventRemove, removeMethod.MethodKind);
Symbols\Source\MethodTests.cs (8)
120Assert.Equal(MethodKind.Constructor, m.MethodKind); 144Assert.Equal(MethodKind.Ordinary, m.MethodKind); 1676Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 1720Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 1766Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 1820Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 1904Assert.Equal(MethodKind.StaticConstructor, staticConstructor.MethodKind); 1928Assert.Equal(MethodKind.StaticConstructor, staticConstructor.MethodKind);
Symbols\Source\NullablePublicAPITests.cs (4)
3491Assert.Equal(MethodKind.LambdaMethod, lambdaSymbol.MethodKind); 3544Assert.Equal(MethodKind.LambdaMethod, innerLambdaSymbol.MethodKind); 3605Assert.Equal(MethodKind.LambdaMethod, innerLambdaSymbol.MethodKind); 4134var localFunctionResult = lookupResults.OfType<IMethodSymbol>().First(m => m.MethodKind == MethodKind.LocalFunction);
Symbols\Source\PropertyTests.cs (20)
604Assert.True(accessor.MethodKind == MethodKind.PropertyGet || accessor.MethodKind == MethodKind.PropertySet, 724VerifyAccessor(goodStatic.GetMethod, goodStatic, MethodKind.PropertyGet); 725VerifyAccessor(goodStatic.SetMethod, goodStatic, MethodKind.PropertySet); 726VerifyAccessor(badStatic.GetMethod, goodStatic, MethodKind.PropertyGet); 727VerifyAccessor(badStatic.SetMethod, goodStatic, MethodKind.PropertySet); 728VerifyAccessor(mismatchedStatic.GetMethod, goodStatic, MethodKind.PropertyGet); 729VerifyAccessor(mismatchedStatic.SetMethod, null, MethodKind.Ordinary); 741VerifyAccessor(goodInstance.GetMethod, goodInstance, MethodKind.PropertyGet); 742VerifyAccessor(goodInstance.SetMethod, goodInstance, MethodKind.PropertySet); 743VerifyAccessor(badInstance.GetMethod, goodInstance, MethodKind.PropertyGet); 744VerifyAccessor(badInstance.SetMethod, goodInstance, MethodKind.PropertySet); 745VerifyAccessor(mismatchedInstance.GetMethod, goodInstance, MethodKind.PropertyGet); 746VerifyAccessor(mismatchedInstance.SetMethod, null, MethodKind.Ordinary); 750VerifyAccessor(staticAndInstance.GetMethod, goodStatic, MethodKind.PropertyGet); 751VerifyAccessor(staticAndInstance.SetMethod, goodInstance, MethodKind.PropertySet); 756VerifyAccessor(getUsedAsSet.GetMethod, goodInstance, MethodKind.PropertyGet); 757VerifyAccessor(getUsedAsSet.SetMethod, goodInstance, MethodKind.PropertyGet); 761private void VerifyAccessor(MethodSymbol accessor, PEPropertySymbol associatedProperty, MethodKind methodKind) 769var method = (methodKind == MethodKind.PropertyGet) ? associatedProperty.GetMethod : associatedProperty.SetMethod;
Symbols\Source\RecordTests.cs (2)
153Assert.Equal(MethodKind.PropertyGet, x.GetMethod!.MethodKind); 187Assert.Equal(MethodKind.PropertyGet, y.GetMethod!.MethodKind);
Symbols\StaticAbstractMembersInInterfacesTests.cs (122)
16083Assert.Equal(MethodKind.Ordinary, cM01.MethodKind); 16145Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 16494Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 16506Assert.Equal(MethodKind.Ordinary, c1M01.MethodKind); 16511Assert.Equal(MethodKind.Ordinary, c2M01.MethodKind); 16579Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 16592Assert.Equal(MethodKind.Ordinary, c1M01.MethodKind); 16598Assert.Equal(MethodKind.Ordinary, c1M01.MethodKind); 16613Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 19318Assert.Equal(MethodKind.UserDefinedOperator, cM01.MethodKind); 19399Assert.Equal(MethodKind.UserDefinedOperator, cM01.MethodKind); 19491Assert.Equal(MethodKind.UserDefinedOperator, cM01.MethodKind); 19589Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 19672Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 19764Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 19853Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 20279Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20280Assert.Equal(MethodKind.UserDefinedOperator, c1.GetMember<MethodSymbol>(opName).MethodKind); 20285Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 20301Assert.Equal(MethodKind.UserDefinedOperator, c2M01.MethodKind); 20414Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20415Assert.Equal(MethodKind.UserDefinedOperator, c1.GetMember<MethodSymbol>(opName).MethodKind); 20420Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 20436Assert.Equal(MethodKind.UserDefinedOperator, c2M01.MethodKind); 20493Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20573Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20665Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20730Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20811Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 20826Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 20833Assert.Equal(MethodKind.UserDefinedOperator, c2M01.MethodKind); 20927Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 20940Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 20946Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 20961Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 21038Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 21051Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21057Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21072Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 21173Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 21186Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21192Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21206Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 22957Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 22972Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 23053Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 23065Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 23143Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 23158Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 23676Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 23734Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 23746Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 23838Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 24028Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 24086Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 24098Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 24190Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 24417Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Get.MethodKind); 24423Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Set.MethodKind); 24447Assert.Equal(MethodKind.PropertyGet, c1M01Get.MethodKind); 24458Assert.Equal(MethodKind.PropertySet, c1M01Set.MethodKind); 24472Assert.Equal(MethodKind.PropertyGet, c2M01Get.MethodKind); 24478Assert.Equal(MethodKind.PropertySet, c2M01Set.MethodKind); 24596Assert.Equal(MethodKind.PropertyGet, c1M01Get.MethodKind); 24606Assert.Equal(MethodKind.PropertySet, c1M01Set.MethodKind); 24621Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01Set.MethodKind); 24657Assert.Equal(MethodKind.PropertyGet, c2M01Get.MethodKind); 24668Assert.Equal(MethodKind.PropertySet, c2M01Set.MethodKind); 24697Assert.Equal(MethodKind.PropertyGet, c3M01Get.MethodKind); 24708Assert.Equal(MethodKind.PropertySet, c3M01Set.MethodKind); 25735Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 25750Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 25830Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 25845Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 26378Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 26390Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 26652Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 26664Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 26945Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Add.MethodKind); 26951Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Remove.MethodKind); 26975Assert.Equal(MethodKind.EventAdd, c1M01Add.MethodKind); 26986Assert.Equal(MethodKind.EventRemove, c1M01Remove.MethodKind); 27000Assert.Equal(MethodKind.EventAdd, c2M01Add.MethodKind); 27006Assert.Equal(MethodKind.EventRemove, c2M01Remove.MethodKind); 27136Assert.Equal(MethodKind.EventAdd, c1M01Add.MethodKind); 27147Assert.Equal(MethodKind.EventRemove, c1M01Remove.MethodKind); 27161Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01Add.MethodKind); 27173Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01Remove.MethodKind); 27213Assert.Equal(MethodKind.EventAdd, c2M01Add.MethodKind); 27225Assert.Equal(MethodKind.EventRemove, c2M01Remove.MethodKind); 27247Assert.Equal(MethodKind.EventAdd, c3M02Add.MethodKind); 27258Assert.Equal(MethodKind.EventRemove, c3M02Remove.MethodKind); 27272Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c3M02Add.MethodKind); 27284Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c3M02Remove.MethodKind); 27326Assert.Equal(MethodKind.EventAdd, c4M02Add.MethodKind); 27339Assert.Equal(MethodKind.EventRemove, c4M02Remove.MethodKind); 28675Assert.Equal(MethodKind.Conversion, cM01.MethodKind); 28700Assert.Equal(MethodKind.Conversion, cM02.MethodKind); 28801Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 28817Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM02.MethodKind); 29018Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29019Assert.Equal(MethodKind.Conversion, c1.GetMember<MethodSymbol>(opName).MethodKind); 29024Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 29040Assert.Equal(MethodKind.Conversion, c2M01.MethodKind); 29098Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29194Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29270Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 29285Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 29292Assert.Equal(MethodKind.Conversion, c2M01.MethodKind); 29385Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 29398Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 29404Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 29419Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 32191var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 32193Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 32228var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 32232Assert.Equal(MethodKind.UserDefinedOperator, opSymbol1.MethodKind); 32238Assert.Equal(MethodKind.UserDefinedOperator, opSymbol2.MethodKind); 32439var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 32441Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 32626var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 32628Assert.Equal(MethodKind.Conversion, opSymbol.MethodKind);
Symbols\TypeTests.cs (2)
1205.Count(m => !(m is MethodSymbol) || (m as MethodSymbol).MethodKind != MethodKind.Constructor)); 2466var method = typeMembers.OfType<MethodSymbol>().First(m => m is { MethodKind: not MethodKind.Constructor });
Symbols\UnsignedRightShiftTests.cs (12)
1988Assert.Equal(MethodKind.UserDefinedOperator, compilation1.GetMember<MethodSymbol>("C1.op_UnsignedRightShift").MethodKind); 1997Assert.Equal(MethodKind.UserDefinedOperator, compilation2.GetMember<MethodSymbol>("C1.op_UnsignedRightShift").MethodKind); 2003Assert.Equal(MethodKind.UserDefinedOperator, compilation3.GetMember<MethodSymbol>("C1.op_UnsignedRightShift").MethodKind); 2240Assert.Equal(MethodKind.UserDefinedOperator, compilation1.GetMember<MethodSymbol>("C1.op_UnsignedRightShift").MethodKind); 2249Assert.Equal(MethodKind.UserDefinedOperator, compilation2.GetMember<MethodSymbol>("C1.op_UnsignedRightShift").MethodKind); 2255Assert.Equal(MethodKind.UserDefinedOperator, compilation3.GetMember<MethodSymbol>("C1.op_UnsignedRightShift").MethodKind); 2706var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2724expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2732expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2878var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2896expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2904expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\LambdaUtilitiesTests.cs (1)
49bool expected = enclosingMethod.MethodKind == MethodKind.LambdaMethod && enclosingSyntax.Span.Contains(span.Value);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (8)
CSharpTrackingDiagnosticAnalyzer.cs (2)
22protected override bool IsOnCodeBlockSupported(SymbolKind symbolKind, MethodKind methodKind, bool returnsVoid) 24return base.IsOnCodeBlockSupported(symbolKind, methodKind, returnsVoid) && methodKind != MethodKind.EventRaise;
Extensions.cs (5)
575case MethodKind.EventAdd: 576case MethodKind.EventRemove: 580case MethodKind.PropertyGet: 581case MethodKind.PropertySet: 583var isSetter = accessor.MethodKind == MethodKind.PropertySet;
FunctionPointerUtilities.cs (1)
58Assert.Equal(MethodKind.FunctionPointerSignature, symbol.MethodKind);
Microsoft.CodeAnalysis.CSharp.Workspaces (17)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
256if (methodSymbol.MethodKind == MethodKind.Constructor) 264return methodSymbol.MethodKind == MethodKind.ReducedExtension
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.cs (1)
48if (symbolInfo.Symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator })
Recommendations\CSharpRecommendationServiceRunner.cs (1)
711if (symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction })
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (1)
33if (member is not IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } method)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
19conversion.MethodSymbol.MethodKind == MethodKind.Conversion &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
372MethodKind: MethodKind.ReducedExtension,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
67if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
921if (sym is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator } op) 1166method.MethodKind is not (MethodKind.LocalFunction or MethodKind.LambdaMethod) && 1336if (originalMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } originalMethodSymbol || 1337rewrittenMemberSymbol is not IMethodSymbol { MethodKind: MethodKind.DelegateInvoke } rewrittenMethodSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
156if (method.MethodKind == MethodKind.Conversion) 162if (method.MethodKind == MethodKind.UserDefinedOperator)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
2017while (enclosingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction or MethodKind.AnonymousFunction } method)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
2495var method = type.GetMembers().Single(m => m is IMethodSymbol { MethodKind: MethodKind.ExplicitInterfaceImplementation }); 4278var method = symbolC.GetMembers().OfType<IMethodSymbol>().Single(m => m.MethodKind == MethodKind.Ordinary);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Utilities\SymbolEquivalenceComparerTests.cs (2)
1871Assert.Equal(MethodKind.ReducedExtension, method1.MethodKind); 1874Assert.Equal(MethodKind.ReducedExtension, method2.MethodKind);
Microsoft.CodeAnalysis.Features (86)
ChangeSignature\AbstractChangeSignatureService.cs (3)
272if (methodSymbol is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet }) 312if (methodSymbol.MethodKind == MethodKind.DelegateInvoke)
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (1)
38=> symbol.MethodKind == MethodKind.DelegateInvoke;
CodeLens\CodeLensFindReferenceProgress.cs (1)
124(definition as IMethodSymbol)?.MethodKind == MethodKind.Constructor;
CodeLens\CodeLensReferencesService.cs (1)
236if (method.MethodKind != MethodKind.AnonymousFunction)
Completion\Providers\AbstractContextVariableArgumentProvider.cs (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)
281MethodKind: MethodKind.BuiltinOperator,
DocumentHighlighting\AbstractDocumentHighlightsService.cs (6)
144case MethodKind.AnonymousFunction: 145case MethodKind.PropertyGet: 146case MethodKind.PropertySet: 147case MethodKind.EventAdd: 148case MethodKind.EventRaise: 149case MethodKind.EventRemove:
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (9)
357MethodKind.Constructor => FeaturesResources.constructor, 358MethodKind.PropertyGet or MethodKind.PropertySet => FeaturesResources.property_accessor, 359MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove => FeaturesResources.event_accessor, 360MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator or MethodKind.Conversion => FeaturesResources.operator_,
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
156method.MethodKind == MethodKind.Ordinary &&
ExtractMethod\Extensions.cs (1)
22if (methodSymbol?.MethodKind != MethodKind.AnonymousFunction)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (1)
128.Any(m => m.MethodKind == MethodKind.UserDefinedOperator &&
GoToBase\AbstractGoToBaseService.cs (1)
47if (bases.Length == 0 && symbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructor)
InheritanceMargin\AbstractInheritanceMarginService.cs (4)
78MethodKind: MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.UserDefinedOperator or MethodKind.Conversion
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
70if (method.MethodKind != MethodKind.Constructor)
InlineHints\AbstractInlineParameterNameHintsService.cs (2)
225if (parameter is not { ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction } method })
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (6)
84var methodKind = methodSymbol.MethodKind; 85if (methodKind is not (MethodKind.Ordinary or MethodKind.LocalFunction or MethodKind.Constructor)) 160if (methodSymbol.MethodKind is not MethodKind.Constructor) 171if (methodSymbol.MethodKind is not MethodKind.LocalFunction)
LanguageServiceIndexFormat\SymbolMoniker.cs (1)
33if (symbol is IMethodSymbol method && method.MethodKind == MethodKind.BuiltinOperator)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
628var extension = method.IsExtensionMethod || method.MethodKind == MethodKind.ReducedExtension;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
50public MethodKind MethodKind => _symbol.MethodKind;
PullMemberUp\MemberAndDestinationValidator.cs (1)
46IMethodSymbol methodSymbol => methodSymbol.MethodKind == MethodKind.Ordinary,
Rename\SymbolicRenameInfo.cs (1)
206if (symbol.Kind == SymbolKind.Method && ((IMethodSymbol)symbol).MethodKind == MethodKind.UserDefinedOperator)
RQName\RQNodeBuilder.cs (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)
98if (methodSymbol.MethodKind is MethodKind.UserDefinedOperator or 99MethodKind.Conversion or 100MethodKind.BuiltinOperator) 105methodSymbol.MethodKind == MethodKind.ReducedExtension) 250case MethodKind.EventAdd: 251case MethodKind.EventRaise: 252case MethodKind.EventRemove: 253case MethodKind.PropertyGet: 254case MethodKind.PropertySet:
src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (1)
19methodSymbol.MethodKind == MethodKind.Constructor &&
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
149return symbol == null || symbol.IsStatic || symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction };
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
705/// 4. If method, then it is a constructor OR a method with <see cref="MethodKind.Ordinary"/>, 729case MethodKind.Constructor: 759case MethodKind.Ordinary:
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
298if (method.MethodKind != MethodKind.Constructor)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
129var isConstructorInitializer = candidates.All(m => m.MethodKind == MethodKind.Constructor);
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
132if (method.MethodKind == MethodKind.ReducedExtension && insertionIndex < existingParameters.Count)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (2)
59MethodKind = MethodKind.Conversion; 83MethodKind = MethodKind.Conversion;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (1)
54MethodKind = MethodKind.Ordinary;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (2)
86MethodKind = MethodKind.Ordinary; 125MethodKind = MethodKind.Ordinary;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
42public MethodKind MethodKind { get; internal set; }
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
368return method1.MethodKind == MethodKind.Ordinary && 369method2.MethodKind == MethodKind.Ordinary &&
src\Analyzers\Core\CodeFixes\Naming\FallbackNamingRules.cs (3)
61var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary)); 80var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary)); 90var kinds = ImmutableArray.Create(new SymbolKindOrTypeKind(MethodKind.Ordinary));
Microsoft.CodeAnalysis.Test.Utilities (25)
Compilation\CompilationExtensions.cs (2)
383if ((parameterInitializerOperation.Parameter.ContainingSymbol as IMethodSymbol)?.MethodKind is not (MethodKind.LocalFunction or MethodKind.AnonymousFunction))
Compilation\ControlFlowGraphVerifier.cs (2)
1716if (method.MethodKind == MethodKind.LocalFunction) 1731if (method.MethodKind == MethodKind.LocalFunction)
Compilation\TestOperationVisitor.cs (1)
810if (method.MethodKind == MethodKind.BuiltinOperator)
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (2)
48bool inConstructor = containingMethod.MethodKind == MethodKind.Constructor; 49ITypeSymbol staticConstructorType = containingMethod.MethodKind == MethodKind.StaticConstructor ? containingMethod.ContainingType : null;
Diagnostics\TrackingDiagnosticAnalyzer.cs (18)
31public readonly MethodKind? MethodKind; 40MethodKind = symbol is IMethodSymbol ? ((IMethodSymbol)symbol).MethodKind : (MethodKind?)null; 107protected virtual bool IsOnCodeBlockSupported(SymbolKind symbolKind, MethodKind methodKind, bool returnsVoid) 114const MethodKind InvalidMethodKind = (MethodKind)(-1); 119new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.Constructor, ReturnsVoid = true }, 120new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.Conversion, ReturnsVoid = false }, 121new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.Destructor, ReturnsVoid = true }, // C# only 122new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.EventAdd, ReturnsVoid = true }, 123new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.EventRemove, ReturnsVoid = true }, 124new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.EventRaise, ReturnsVoid = true }, // VB only 125new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.ExplicitInterfaceImplementation, ReturnsVoid = true }, // C# only 126new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.Ordinary, ReturnsVoid = false }, 127new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.Ordinary, ReturnsVoid = true }, 128new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.PropertyGet, ReturnsVoid = false }, 129new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.PropertySet, ReturnsVoid = true }, 130new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.StaticConstructor, ReturnsVoid = true }, 131new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.UserDefinedOperator, ReturnsVoid = false },
Microsoft.CodeAnalysis.VisualBasic (528)
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)
1914Public 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)
138DirectCast(symbol, MethodSymbol).MethodKind = MethodKind.Constructor Then 423Dim sourceTypeBinder As Binder = If(method.MethodKind = MethodKind.Ordinary, Nothing, 691If method.MethodKind = MethodKind.SharedConstructor Then 693ElseIf method.MethodKind = MethodKind.Constructor OrElse method.IsScriptInitializer Then 767sourceMethod.MethodKind = MethodKind.Constructor AndAlso 1475If method.MethodKind = MethodKind.Constructor OrElse method.MethodKind = MethodKind.SharedConstructor Then 1811If method.MethodKind = MethodKind.Constructor Then 1847If referencedMethod IsNot Nothing AndAlso referencedMethod.MethodKind = MethodKind.Constructor Then 1908Debug.Assert(constructor.MethodKind = MethodKind.Constructor)
Compilation\SemanticModel.vb (1)
1867(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)
481If 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)
405If _currentParent.MethodKind <> MethodKind.LambdaMethod Then 432Loop 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 (1)
3395DirectCast(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)
186Public Overrides ReadOnly Property MethodKind As MethodKind 188Return 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 (50)
86Public Property MethodKind As MethodKind 88Return CType((_bits >> s_methodKindOffset) And s_methodKindMask, MethodKind) 90Set(value As MethodKind) 160Public Sub InitializeMethodKind(methodKind As MethodKind) 344Public Overrides ReadOnly Property MethodKind As MethodKind 361Private Function ComputeMethodKind() As MethodKind 383Return MethodKind.SharedConstructor 386Return MethodKind.Constructor 390Return MethodKind.Ordinary 404Return MethodKind.Ordinary 409Return MethodKind.DelegateInvoke 412Return MethodKind.Ordinary 417Return _packedFlags.MethodKind = MethodKind.Constructor AndAlso ParameterCount = 0 432_packedFlags.MethodKind = MethodKind.Constructor 439Private Function ComputeMethodKindForPotentialOperatorOrConversion(opInfo As OverloadResolution.OperatorInfo) As MethodKind 445Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.Conversion, WellKnownMemberNames.ExplicitConversionName, True) 447Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.Conversion, WellKnownMemberNames.ImplicitConversionName, True) 449Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 452Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 454Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.OnesComplementOperatorName, False) 478Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 482Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 484Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.BitwiseAndOperatorName, False) 488Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 490Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.BitwiseOrOperatorName, False) 494Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 496Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.LeftShiftOperatorName, False) 500Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False) 502Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.RightShiftOperatorName, False) 519potentialMethodKind As MethodKind, 522) As MethodKind 523Debug.Assert(potentialMethodKind = MethodKind.Conversion OrElse potentialMethodKind = MethodKind.UserDefinedOperator) 525Dim result As MethodKind = potentialMethodKind 547Case MethodKind.Ordinary 560If potentialMethodKind = MethodKind.Conversion AndAlso Not outputType.IsSameTypeIgnoringAll(contender.ReturnType) Then 576result = MethodKind.Ordinary 580contender._packedFlags.InitializeMethodKind(MethodKind.Ordinary) 664Me.MethodKind = MethodKind.Ordinary AndAlso 891Me.MethodKind = MethodKind.PropertySet AndAlso 974Friend Function SetAssociatedProperty(propertySymbol As PEPropertySymbol, methodKind As MethodKind) As Boolean 975Debug.Assert((methodKind = MethodKind.PropertyGet) OrElse (methodKind = MethodKind.PropertySet)) 983Friend Function SetAssociatedEvent(eventSymbol As PEEventSymbol, methodKind As MethodKind) As Boolean 984Debug.Assert((methodKind = MethodKind.EventAdd) OrElse (methodKind = MethodKind.EventRemove) OrElse (methodKind = MethodKind.EventRaise)) 988Private Function SetAssociatedPropertyOrEvent(propertyOrEventSymbol As Symbol, methodKind As MethodKind) As Boolean 1239MethodKind = MethodKind.Constructor AndAlso 1339If MethodKind <> MethodKind.Constructor Then
Symbols\Metadata\PE\PEPropertySymbol.vb (2)
127_getMethod.SetAssociatedProperty(Me, MethodKind.PropertyGet) 131_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 (7)
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 466Return Me.MethodKind = MethodKind.Constructor AndAlso Me.ContainingType.IsScriptClass 923Private ReadOnly Property IMethodSymbol_MethodKind As MethodKind Implements IMethodSymbol.MethodKind
Symbols\MethodSymbolExtensions.vb (2)
86Case MethodKind.UserDefinedOperator, MethodKind.Conversion
Symbols\NamedTypeSymbol.vb (2)
421Debug.Assert(method.MethodKind = MethodKind.Constructor) 429Debug.Assert(method.MethodKind = MethodKind.StaticConstructor)
Symbols\ObsoleteAttributeHelpers.vb (1)
160Dim 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)
434Public 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)
56If Me.MethodKind = MethodKind.EventRaise Then 143Return Not (Me.MethodKind = MethodKind.EventAdd AndAlso _event.IsWindowsRuntimeEvent) 167If(Me.MethodKind = MethodKind.EventRaise, 174If Me.MethodKind = MethodKind.EventRaise Then 214If Me.MethodKind = MethodKind.EventAdd Then 220Debug.Assert(Me.MethodKind = MethodKind.EventRemove)
Symbols\Source\LambdaSymbol.vb (2)
272Public Overrides ReadOnly Property MethodKind As MethodKind 274Return 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)
198Return Me.MethodKind = MethodKind.Constructor
Symbols\Source\SourceEventSymbol.vb (7)
104Case MethodKind.EventAdd 111Case MethodKind.EventRemove 118Case MethodKind.EventRaise 388Friend Function GetAccessorImplementations(kind As MethodKind) As ImmutableArray(Of MethodSymbol) 402Case MethodKind.EventAdd 404Case MethodKind.EventRemove 406Case MethodKind.EventRaise
Symbols\Source\SourceMemberContainerTypeSymbol.vb (19)
961Case MethodKind.EventAdd, MethodKind.EventRemove, MethodKind.PropertyGet, MethodKind.PropertySet 974If syntax Is Nothing AndAlso method.MethodKind = MethodKind.DelegateInvoke Then 1748If method IsNot Nothing AndAlso method.IsPartial AndAlso method.MethodKind = MethodKind.Ordinary Then 1798If candidate IsNot Nothing AndAlso candidate IsNot originalPartialMethod AndAlso candidate.MethodKind = MethodKind.Ordinary Then 2454Return sourceMethodSymbol.MethodKind = MethodKind.Ordinary OrElse sourceMethodSymbol.MethodKind = MethodKind.DeclareMethod 2757(DirectCast(sym, MethodSymbol).MethodKind = MethodKind.Constructor OrElse 2758DirectCast(sym, MethodSymbol).MethodKind = MethodKind.SharedConstructor) 2762If method.MethodKind = MethodKind.Constructor AndAlso method.ParameterCount = 0 Then 3432method.MethodKind <> MethodKind.Ordinary AndAlso 3433method.MethodKind <> MethodKind.UserDefinedOperator AndAlso 3434method.MethodKind <> MethodKind.Conversion Then 3596Dim methodMethodKind As MethodKind = method.MethodKind 3599Case MethodKind.Conversion 3601Case MethodKind.UserDefinedOperator 3621If methodMethodKind = MethodKind.Conversion Then
Symbols\Source\SourceMemberMethodSymbol.vb (1)
107If MethodKind = MethodKind.Ordinary Then
Symbols\Source\SourceMethodSymbol.vb (30)
629Public Overrides ReadOnly Property MethodKind As MethodKind 1274Debug.Assert(Me.MethodKind <> MethodKind.EventAdd, 1499If Not (Me.MethodKind <> MethodKind.Ordinary AndAlso Me.MethodKind <> MethodKind.DeclareMethod) AndAlso 1603If Me.MethodKind <> MethodKind.Ordinary AndAlso Me.MethodKind <> MethodKind.DeclareMethod Then 1775Case MethodKind.DeclareMethod 1779Case MethodKind.PropertyGet, MethodKind.PropertySet 1783Case MethodKind.EventAdd, MethodKind.EventRaise, MethodKind.EventRemove 1867Debug.Assert(MethodKind <> MethodKind.DeclareMethod) 1958Case MethodKind.Constructor, 1959MethodKind.SharedConstructor, 1960MethodKind.PropertyGet, 1961MethodKind.PropertySet, 1962MethodKind.EventAdd, 1963MethodKind.EventRemove, 1964MethodKind.EventRaise, 1965MethodKind.Conversion, 1966MethodKind.UserDefinedOperator 2253Case MethodKind.Constructor, 2254MethodKind.SharedConstructor, 2255MethodKind.EventRemove, 2256MethodKind.EventRaise 2261Case MethodKind.EventAdd 2267Case MethodKind.PropertyGet, MethodKind.PropertySet 2289If Me.MethodKind = MethodKind.UserDefinedOperator Then
Symbols\Source\SourceNamedTypeSymbol.vb (2)
2650If method.MethodKind = MethodKind.Constructor AndAlso method.ParameterCount = 0 Then 2659If method.MethodKind = MethodKind.Constructor AndAlso method.CanBeCalledWithNoParameters() Then
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (8)
381If DirectCast(member, MethodSymbol).MethodKind <> MethodKind.Ordinary Then 547Debug.Assert(method.MethodKind = MethodKind.Ordinary) 1223Public Overrides ReadOnly Property MethodKind As MethodKind 1226Case MethodKind.PropertyGet 1227Return MethodKind.PropertyGet 1228Case MethodKind.PropertySet 1229Return MethodKind.PropertySet 1231Return 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)
36If(flags.ToMethodKind() = MethodKind.PropertyGet, flags, flags And Not SourceMemberFlags.Iterator), 105If methodKind = MethodKind.PropertySet Then 121Return m_property.GetAccessorOverride(getter:=(MethodKind = MethodKind.PropertyGet)) 226Case MethodKind.PropertyGet 239Case MethodKind.PropertySet 293Return If(MethodKind = MethodKind.PropertyGet, 338m_property.GetAccessorImplementations(getter:=(MethodKind = MethodKind.PropertyGet)), 353Return If(Me.MethodKind = MethodKind.PropertySet, ImmutableArray(Of CustomModifier).Empty, m_property.TypeCustomModifiers) 367Debug.Assert(Me.MethodKind = MethodKind.PropertySet) 373Return If(Me.MethodKind = MethodKind.PropertyGet, m_property, Nothing) 396Dim isSetter As Boolean = (method.MethodKind = MethodKind.PropertySet)
Symbols\Source\SourcePropertySymbol.vb (2)
204Binder.GetAccessorName(prop.Name, MethodKind.PropertyGet, isWinMd:=False), 213Binder.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)
279Public Overrides ReadOnly Property MethodKind As MethodKind
Symbols\SubstitutedNamedType.vb (6)
457Case MethodKind.PropertyGet, MethodKind.PropertySet 460Return If(memberMethod.MethodKind = MethodKind.PropertyGet, propertySymbol.GetMethod, propertySymbol.SetMethod) 462Case MethodKind.EventAdd 467Case MethodKind.EventRemove 472Case MethodKind.EventRaise
Symbols\Symbol.vb (12)
618Case MethodKind.Ordinary, MethodKind.DeclareMethod, MethodKind.ReducedExtension 620Case MethodKind.DelegateInvoke, MethodKind.UserDefinedOperator, MethodKind.Conversion 658Case MethodKind.Ordinary, MethodKind.DeclareMethod, MethodKind.ReducedExtension, MethodKind.DelegateInvoke, MethodKind.UserDefinedOperator, MethodKind.Conversion
Symbols\Symbol_Attributes.vb (12)
74Case MethodKind.Constructor, 75MethodKind.SharedConstructor 78Case MethodKind.Ordinary, 79MethodKind.DeclareMethod, 80MethodKind.UserDefinedOperator, 81MethodKind.Conversion, 82MethodKind.PropertyGet, 83MethodKind.PropertySet, 84MethodKind.EventAdd, 85MethodKind.EventRaise, 86MethodKind.EventRemove, 87MethodKind.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)
311Public Overrides ReadOnly Property MethodKind As MethodKind 415Return Me.MethodKind = MethodKind.Constructor
Symbols\SynthesizedSymbols\SynthesizedGlobalMethodBase.vb (2)
155Public Overrides ReadOnly Property MethodKind As MethodKind 157Return 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\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\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
184Return If(methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.Constructor, methodSymbol, Nothing)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
163methodKind:=MethodKind.Conversion)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
153If method.MethodKind = MethodKind.UserDefinedOperator Then 157If method.MethodKind = MethodKind.Conversion Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (1)
19If symbol.IsStatic AndAlso Not symbol.MethodKind = MethodKind.ReducedExtension Then
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (3)
Attributes\AttributeTests_Tuples.vb (1)
254If DirectCast(s, MethodSymbol).MethodKind = MethodKind.EventRaise Then
Emit\EmitMetadata.vb (2)
785Assert.Equal(MethodKind.Constructor, ctor.MethodKind) 806Assert.Equal(MethodKind.SharedConstructor, cctor.MethodKind)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (6)
Symbols\EEMethodSymbol.vb (2)
188Public Overrides ReadOnly Property MethodKind As MethodKind 190Return MethodKind.Ordinary
Symbols\PlaceholderMethodSymbol.vb (2)
101Public Overrides ReadOnly Property MethodKind As MethodKind 103Return MethodKind.Ordinary
Symbols\SynthesizedContextMethodSymbol.vb (2)
63Public Overrides ReadOnly Property MethodKind As MethodKind 65Return MethodKind.Ordinary
Microsoft.CodeAnalysis.VisualBasic.Features (14)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
358If methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.ReducedExtension Then
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (2)
164If methodSymbol.MethodKind = MethodKind.PropertyGet Then 166ElseIf methodSymbol.MethodKind = MethodKind.PropertySet Then
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (6)
643If method Is Nothing OrElse (method.MethodKind <> MethodKind.Constructor AndAlso method.MethodKind <> MethodKind.SharedConstructor) Then 1441Case MethodKind.StaticConstructor 1443Case MethodKind.LambdaMethod 2034If method.MethodKind = MethodKind.Conversion OrElse method.MethodKind = MethodKind.UserDefinedOperator Then
NavigationBar\VisualBasicNavigationBarItemService.vb (3)
277Return method.MethodKind = MethodKind.Ordinary OrElse 278method.MethodKind = MethodKind.UserDefinedOperator OrElse 279method.MethodKind = MethodKind.Conversion
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
184Return If(methodSymbol IsNot Nothing AndAlso methodSymbol.MethodKind = MethodKind.Constructor, methodSymbol, Nothing)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
163methodKind:=MethodKind.Conversion)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (23)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (2)
1152Assert.Equal(MethodKind.Conversion, sym1.MethodKind) 1153Assert.Equal(MethodKind.UserDefinedOperator, sym2.MethodKind)
DeclaringSyntaxNodeTests.vb (2)
134Assert.Equal(MethodKind.LambdaMethod, sym.MethodKind) 514If memb.Kind = SymbolKind.Method AndAlso (DirectCast(memb, MethodSymbol)).MethodKind = MethodKind.Constructor Then
ExtensionMethods\SemanticModelTests.vb (3)
61Assert.Equal(MethodKind.ReducedExtension, method.MethodKind) 65Assert.Equal(MethodKind.Ordinary, method.CallsiteReducedFromMethod.MethodKind) 70Assert.Equal(MethodKind.ReducedExtension, reducedMethod.MethodKind)
Semantics\AnonymousTypesTests.vb (3)
1501Assert.Equal(MethodKind.LambdaMethod, lambda2.MethodKind) 1546Assert.Equal(MethodKind.LambdaMethod, lambda2.MethodKind) 1591Assert.Equal(MethodKind.LambdaMethod, lambda2.MethodKind)
Semantics\BinaryOperators.vb (2)
1109If method.MethodKind = MethodKind.UserDefinedOperator AndAlso 1225Assert.Equal(MethodKind.BuiltinOperator, symbol1.MethodKind)
Semantics\GetExtendedSemanticInfoTests.vb (4)
4359Assert.Equal(MethodKind.Constructor, method.MethodKind) 4398Assert.Equal(MethodKind.Constructor, method.MethodKind) 4434Assert.Equal(MethodKind.Constructor, method.MethodKind) 4473Assert.Equal(MethodKind.Constructor, method.MethodKind)
Semantics\OptionalArgumentTests.vb (5)
2202Dim methods = [module].GlobalNamespace.GetMember(Of NamedTypeSymbol)("C").GetMembers().OfType(Of MethodSymbol)().Where(Function(m) m.MethodKind = MethodKind.Ordinary).ToArray() 2313Dim methods = [module].GlobalNamespace.GetMember(Of NamedTypeSymbol)("C").GetMembers().OfType(Of MethodSymbol)().Where(Function(m) m.MethodKind = MethodKind.Ordinary).ToArray() 2402Dim methods = [module].GlobalNamespace.GetMember(Of NamedTypeSymbol)("C").GetMembers().OfType(Of MethodSymbol)().Where(Function(m) m.MethodKind = MethodKind.Ordinary).ToArray() 2524Dim methods = [module].GlobalNamespace.GetMember(Of NamedTypeSymbol)("C").GetMembers().OfType(Of MethodSymbol)().Where(Function(m) m.MethodKind = MethodKind.Ordinary).ToArray() 2685Dim methods = [module].GlobalNamespace.GetMember(Of NamedTypeSymbol)("C").GetMembers().OfType(Of MethodSymbol)().Where(Function(m) m.MethodKind = MethodKind.Ordinary).ToArray()
Semantics\UnaryOperators.vb (1)
756Assert.Equal(MethodKind.BuiltinOperator, symbol1.MethodKind)
Semantics\UsingStatementTest.vb (1)
345If (DirectCast(type.Symbol, MethodSymbol).MethodKind = MethodKind.Constructor) Then
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (259)
SymbolsTests\AnonymousDelegates\AnonymousDelegates_CreationAndEmit.vb (4)
306Assert.Equal(MethodKind.Constructor, x16.GetMethod(".ctor").MethodKind) 308Assert.Equal(MethodKind.DelegateInvoke, x16.GetMember(Of MethodSymbol)("Invoke").MethodKind) 310Assert.Equal(MethodKind.Ordinary, x16.GetMember(Of MethodSymbol)("BeginInvoke").MethodKind) 312Assert.Equal(MethodKind.Ordinary, x16.GetMember(Of MethodSymbol)("EndInvoke").MethodKind)
SymbolsTests\CheckedUserDefinedOperatorsTests.vb (18)
179If m.MethodKind <> MethodKind.Constructor Then 180Assert.Equal(MethodKind.Ordinary, m.MethodKind) 188Dim operators = c0_3.GetMembers().OfType(Of IMethodSymbol)().Where(Function(m) m.MethodKind <> MethodKind.Constructor).ToArray() 193Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind) 254If m.MethodKind <> MethodKind.Constructor Then 255Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind) 366If m.MethodKind <> MethodKind.Constructor Then 367Assert.Equal(MethodKind.Ordinary, m.MethodKind) 375Dim operators = c0_3.GetMembers().OfType(Of IMethodSymbol)().Where(Function(m) m.MethodKind <> MethodKind.Constructor).ToArray() 379Assert.Equal(MethodKind.UserDefinedOperator, operators(0).MethodKind) 437If m.MethodKind <> MethodKind.Constructor Then 438Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind) 545If m.MethodKind <> MethodKind.Constructor Then 546Assert.Equal(MethodKind.Ordinary, m.MethodKind) 554Dim operators = c0_3.GetMembers().OfType(Of IMethodSymbol)().Where(Function(m) m.MethodKind <> MethodKind.Constructor).ToArray() 558Assert.Equal(MethodKind.Conversion, operators(0).MethodKind) 612If m.MethodKind <> MethodKind.Constructor Then 613Assert.Equal(MethodKind.Conversion, m.MethodKind)
SymbolsTests\Metadata\MetadataMemberTests.vb (4)
168Assert.Equal(MethodKind.Constructor, ctor.MethodKind) 214Assert.Equal(MethodKind.Ordinary, member1.MethodKind) 732If m.MethodKind = MethodKind.Constructor Then 737Assert.NotEqual(MethodKind.Ordinary, m.MethodKind)
SymbolsTests\Metadata\PE\LoadingEvents.vb (2)
105Case MethodKind.EventAdd 108Case MethodKind.EventRemove
SymbolsTests\Metadata\PE\LoadingMethods.vb (16)
393Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind) 422Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind) 456Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind) 488Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind) 515Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind) 541Assert.Equal(MethodKind.Ordinary, classMethod.MethodKind) 545Assert.Equal(MethodKind.Ordinary, classGenericMethod.MethodKind) 772Assert.Equal(If(m.Name = ".cctor", MethodKind.SharedConstructor, MethodKind.Constructor), DirectCast(m, MethodSymbol).MethodKind) 776Assert.Equal(MethodKind.Ordinary, DirectCast(m, MethodSymbol).MethodKind) 780Assert.Equal(MethodKind.Ordinary, DirectCast(m, MethodSymbol).MethodKind) 784Assert.Equal(MethodKind.Ordinary, DirectCast(m, MethodSymbol).MethodKind) 788Assert.Equal(MethodKind.Ordinary, DirectCast(m, MethodSymbol).MethodKind) 792Assert.Equal(MethodKind.Ordinary, DirectCast(m, MethodSymbol).MethodKind) 796Assert.Equal(MethodKind.Ordinary, DirectCast(m, MethodSymbol).MethodKind) 800Assert.Equal(MethodKind.Ordinary, DirectCast(m, MethodSymbol).MethodKind)
SymbolsTests\Metadata\PE\LoadingOperators.vb (122)
556New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator +(x As A1, y As A1) As A1"), 557New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator And(x As A1, y As A1) As A1"), 558New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function op_LogicalAnd(x As A1, y As A1) As A1"), 559New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Or(x As A1, y As A1) As A1"), 560New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function op_LogicalOr(x As A1, y As A1) As A1"), 561New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator &(x As A1, y As A1) As A1"), 562New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator /(x As A1, y As A1) As A1"), 563New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator =(x As A1, y As A1) As A1"), 564New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Xor(x As A1, y As A1) As A1"), 565New BaseLine(MethodKind.Conversion, "Public Shared Overloads Narrowing Operator CType(x As A1) As Byte"), 566New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator ^(x As A1, y As A1) As A1"), 567New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator IsFalse(x As A1) As Boolean"), 568New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator >(x As A1, y As A1) As A1"), 569New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator >=(x As A1, y As A1) As A1"), 570New BaseLine(MethodKind.Conversion, "Public Shared Overloads Widening Operator CType(x As A1) As Integer"), 571New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <>(x As A1, y As A1) As A1"), 572New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator \(x As A1, y As A1) As A1"), 573New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <<(x As A1, y As Integer) As A1"), 574New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function op_UnsignedLeftShift(x As A1, y As Integer) As A1"), 575New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <(x As A1, y As A1) As A1"), 576New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <=(x As A1, y As A1) As A1"), 577New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Like(x As A1, y As A1) As A1"), 578New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Mod(x As A1, y As A1) As A1"), 579New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator *(x As A1, y As A1) As A1"), 580New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Not(x As A1) As A1"), 581New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function op_LogicalNot(x As A1) As A1"), 582New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator >>(x As A1, y As Integer) As A1"), 583New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function op_UnsignedRightShift(x As A1, y As Integer) As A1"), 584New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator -(x As A1, y As A1) As A1"), 585New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator IsTrue(x As A1) As Boolean"), 586New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator -(x As A1) As A1"), 587New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator +(x As A1) As A1")} 608Public ReadOnly Kind As MethodKind 611Public Sub New(kind As MethodKind, display As String) 1152New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator +(x As A1, y As A1) As A1"), 1153New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator And(x As A1, y As A1) As A1"), 1154New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function OP_LOGICALAND(x As A1, y As A1) As A1"), 1155New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Or(x As A1, y As A1) As A1"), 1156New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function OP_LOGICALOR(x As A1, y As A1) As A1"), 1157New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator &(x As A1, y As A1) As A1"), 1158New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator /(x As A1, y As A1) As A1"), 1159New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator =(x As A1, y As A1) As A1"), 1160New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Xor(x As A1, y As A1) As A1"), 1161New BaseLine(MethodKind.Conversion, "Public Shared Overloads Narrowing Operator CType(x As A1) As Byte"), 1162New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator ^(x As A1, y As A1) As A1"), 1163New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator IsFalse(x As A1) As Boolean"), 1164New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator >(x As A1, y As A1) As A1"), 1165New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator >=(x As A1, y As A1) As A1"), 1166New BaseLine(MethodKind.Conversion, "Public Shared Overloads Widening Operator CType(x As A1) As Integer"), 1167New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <>(x As A1, y As A1) As A1"), 1168New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator \(x As A1, y As A1) As A1"), 1169New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <<(x As A1, y As Integer) As A1"), 1170New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function OP_UNSIGNEDLEFTSHIFT(x As A1, y As Integer) As A1"), 1171New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <(x As A1, y As A1) As A1"), 1172New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <=(x As A1, y As A1) As A1"), 1173New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Like(x As A1, y As A1) As A1"), 1174New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Mod(x As A1, y As A1) As A1"), 1175New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator *(x As A1, y As A1) As A1"), 1176New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Not(x As A1) As A1"), 1177New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function OP_LOGICALNOT(x As A1) As A1"), 1178New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator >>(x As A1, y As Integer) As A1"), 1179New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function OP_UNSIGNEDRIGHTSHIFT(x As A1, y As Integer) As A1"), 1180New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator -(x As A1, y As A1) As A1"), 1181New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator IsTrue(x As A1) As Boolean"), 1182New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator -(x As A1) As A1"), 1183New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator +(x As A1) As A1")} 1375Assert.Equal(MethodKind.Ordinary, method.MethodKind) 1914New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator +(x As A1, y As A1) As A1"), 1915New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator And(x As A1, y As A1) As A1"), 1916New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function op_LogicalAnd(x As A1, y As A1) As A1"), 1917New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Or(x As A1, y As A1) As A1"), 1918New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function op_LogicalOr(x As A1, y As A1) As A1"), 1919New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator &(x As A1, y As A1) As A1"), 1920New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator /(x As A1, y As A1) As A1"), 1921New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator =(x As A1, y As A1) As A1"), 1922New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Xor(x As A1, y As A1) As A1"), 1923New BaseLine(MethodKind.Conversion, "Public Shared Overloads Narrowing Operator CType(x As A1) As Byte"), 1924New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator ^(x As A1, y As A1) As A1"), 1925New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator IsFalse(x As A1) As Boolean"), 1926New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator >(x As A1, y As A1) As A1"), 1927New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator >=(x As A1, y As A1) As A1"), 1928New BaseLine(MethodKind.Conversion, "Public Shared Overloads Widening Operator CType(x As A1) As Integer"), 1929New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <>(x As A1, y As A1) As A1"), 1930New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator \(x As A1, y As A1) As A1"), 1931New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <<(x As A1, y As Integer) As A1"), 1932New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function op_UnsignedLeftShift(x As A1, y As Integer) As A1"), 1933New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <(x As A1, y As A1) As A1"), 1934New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <=(x As A1, y As A1) As A1"), 1935New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Like(x As A1, y As A1) As A1"), 1936New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Mod(x As A1, y As A1) As A1"), 1937New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator *(x As A1, y As A1) As A1"), 1938New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Not(x As A1) As A1"), 1939New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function op_LogicalNot(x As A1) As A1"), 1940New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator >>(x As A1, y As Integer) As A1"), 1941New BaseLine(MethodKind.Ordinary, "Public Shared Overloads Function op_UnsignedRightShift(x As A1, y As Integer) As A1"), 1942New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator -(x As A1, y As A1) As A1"), 1943New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator IsTrue(x As A1) As Boolean"), 1944New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator -(x As A1) As A1"), 1945New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator +(x As A1) As A1")} 2075New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator And(x As A1, y As A1) As A1"), 2076New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Or(x As A1, y As A1) As A1"), 2077New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator <<(x As A1, y As Integer) As A1"), 2078New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator Not(x As A1) As A1"), 2079New BaseLine(MethodKind.UserDefinedOperator, "Public Shared Overloads Operator >>(x As A1, y As Integer) As A1")} 2192Assert.Equal(MethodKind.Ordinary, DirectCast(a11.GetMembers("op_LogicalNot").Single(), MethodSymbol).MethodKind) 2195Assert.Equal(MethodKind.Ordinary, DirectCast(m, MethodSymbol).MethodKind) 2292Assert.Equal(MethodKind.Ordinary, DirectCast(a11.GetMembers().Where(Function(m) m.Name.Equals("op_OnesComplement")).Single(), MethodSymbol).MethodKind) 2293Assert.Equal(MethodKind.Ordinary, DirectCast(a11.GetMembers().Where(Function(m) m.Name.Equals("OP_ONESCOMPLEMENT")).Single(), MethodSymbol).MethodKind) 2294Assert.Equal(MethodKind.Ordinary, DirectCast(a11.GetMembers("op_LogicalNot").Single(), MethodSymbol).MethodKind) 2390Assert.Equal(MethodKind.Ordinary, DirectCast(a11.GetMembers().Where(Function(m) m.Name.Equals("OP_ONESCOMPLEMENT")).Single(), MethodSymbol).MethodKind) 2391Assert.Equal(MethodKind.Ordinary, DirectCast(a11.GetMembers().Where(Function(m) m.Name.Equals("op_OnesComplement")).Single(), MethodSymbol).MethodKind) 2392Assert.Equal(MethodKind.Ordinary, DirectCast(a11.GetMembers("op_LogicalNot").Single(), MethodSymbol).MethodKind) 2470Assert.Equal(MethodKind.Ordinary, DirectCast(a11.GetMembers("op_LogicalNot").Single(), MethodSymbol).MethodKind) 2471Assert.Equal(MethodKind.UserDefinedOperator, DirectCast(a11.GetMembers("op_OnesComplement").Single(), MethodSymbol).MethodKind) 2549Assert.Equal(MethodKind.UserDefinedOperator, DirectCast(a11.GetMembers("op_OnesComplement").Single(), MethodSymbol).MethodKind) 2550Assert.Equal(MethodKind.Ordinary, DirectCast(a11.GetMembers("op_LogicalNot").Single(), MethodSymbol).MethodKind) 2628Assert.Equal(MethodKind.UserDefinedOperator, DirectCast(a11.GetMembers().Where(Function(m) m.Name.Equals("op_OnesComplement")).Single(), MethodSymbol).MethodKind) 2629Assert.Equal(MethodKind.Ordinary, DirectCast(a11.GetMembers().Where(Function(m) m.Name.Equals("OP_ONESCOMPLEMENT")).Single(), MethodSymbol).MethodKind) 2692Assert.Equal(MethodKind.UserDefinedOperator, DirectCast(a11.GetMembers().Where(Function(m) m.Name.Equals("op_OnesComplement")).Single(), MethodSymbol).MethodKind) 2782Assert.Equal(MethodKind.UserDefinedOperator, DirectCast(m, MethodSymbol).MethodKind) 2804Assert.Equal(MethodKind.Conversion, op_Implicit.MethodKind) 2805Assert.Equal(MethodKind.Conversion, op_Explicit.MethodKind)
SymbolsTests\Source\DelegateTests.vb (1)
248Assert.Equal(MethodKind.DelegateInvoke, invoke.MethodKind)
SymbolsTests\Source\EventTests.vb (2)
1732Assert.Equal(MethodKind.EventAdd, DirectCast(mems(2), MethodSymbol).MethodKind) 1736Assert.Equal(MethodKind.EventRemove, DirectCast(mems(4), MethodSymbol).MethodKind)
SymbolsTests\Source\ImplementsTests.vb (1)
3813Single(Function(m) m.ExplicitInterfaceImplementations.Single().MethodKind = MethodKind.EventAdd)
SymbolsTests\Source\MethodTests.vb (9)
67Assert.Equal(MethodKind.Constructor, ctor.MethodKind) 86Assert.Equal(MethodKind.Ordinary, m1.MethodKind) 194Assert.Equal(MethodKind.Ordinary, m1.MethodKind) 243Assert.Equal(MethodKind.Constructor, m1.MethodKind) 262Assert.Equal(MethodKind.Constructor, m2.MethodKind) 316Assert.Equal(MethodKind.SharedConstructor, m1.MethodKind) 336Assert.Equal(MethodKind.SharedConstructor, m2.MethodKind) 389Assert.Equal(MethodKind.Constructor, m1.MethodKind) 414Assert.Equal(MethodKind.Constructor, m2.MethodKind)
SymbolsTests\Source\OperatorsTests.vb (60)
155New BaseLine(MethodKind.UserDefinedOperator, "op_UnaryPlus"), 156New BaseLine(MethodKind.UserDefinedOperator, "op_UnaryNegation"), 157New BaseLine(MethodKind.UserDefinedOperator, "op_OnesComplement"), 158New BaseLine(MethodKind.UserDefinedOperator, "op_True"), 159New BaseLine(MethodKind.UserDefinedOperator, "op_False"), 160New BaseLine(MethodKind.UserDefinedOperator, "op_Addition"), 161New BaseLine(MethodKind.UserDefinedOperator, "op_Subtraction"), 162New BaseLine(MethodKind.UserDefinedOperator, "op_Multiply"), 163New BaseLine(MethodKind.UserDefinedOperator, "op_Division"), 164New BaseLine(MethodKind.UserDefinedOperator, "op_IntegerDivision"), 165New BaseLine(MethodKind.UserDefinedOperator, "op_Modulus"), 166New BaseLine(MethodKind.UserDefinedOperator, "op_Exponent"), 167New BaseLine(MethodKind.UserDefinedOperator, "op_Equality"), 168New BaseLine(MethodKind.UserDefinedOperator, "op_Inequality"), 169New BaseLine(MethodKind.UserDefinedOperator, "op_LessThan"), 170New BaseLine(MethodKind.UserDefinedOperator, "op_GreaterThan"), 171New BaseLine(MethodKind.UserDefinedOperator, "op_LessThanOrEqual"), 172New BaseLine(MethodKind.UserDefinedOperator, "op_GreaterThanOrEqual"), 173New BaseLine(MethodKind.UserDefinedOperator, "op_Like"), 174New BaseLine(MethodKind.UserDefinedOperator, "op_Concatenate"), 175New BaseLine(MethodKind.UserDefinedOperator, "op_BitwiseAnd"), 176New BaseLine(MethodKind.UserDefinedOperator, "op_BitwiseOr"), 177New BaseLine(MethodKind.UserDefinedOperator, "op_ExclusiveOr"), 178New BaseLine(MethodKind.UserDefinedOperator, "op_LeftShift"), 179New BaseLine(MethodKind.UserDefinedOperator, "op_RightShift"), 180New BaseLine(MethodKind.Conversion, "op_Implicit"), 181New BaseLine(MethodKind.Conversion, "op_Explicit") 240Public ReadOnly Kind As MethodKind 243Public Sub New(kind As MethodKind, name As String) 360New BaseLine(MethodKind.UserDefinedOperator, "op_UnaryPlus"), 361New BaseLine(MethodKind.UserDefinedOperator, "op_UnaryNegation"), 362New BaseLine(MethodKind.UserDefinedOperator, "op_OnesComplement"), 363New BaseLine(MethodKind.UserDefinedOperator, "op_True"), 364New BaseLine(MethodKind.UserDefinedOperator, "op_False"), 365New BaseLine(MethodKind.UserDefinedOperator, "op_Addition"), 366New BaseLine(MethodKind.UserDefinedOperator, "op_Subtraction"), 367New BaseLine(MethodKind.UserDefinedOperator, "op_Multiply"), 368New BaseLine(MethodKind.UserDefinedOperator, "op_Division"), 369New BaseLine(MethodKind.UserDefinedOperator, "op_IntegerDivision"), 370New BaseLine(MethodKind.UserDefinedOperator, "op_Modulus"), 371New BaseLine(MethodKind.UserDefinedOperator, "op_Exponent"), 372New BaseLine(MethodKind.UserDefinedOperator, "op_Equality"), 373New BaseLine(MethodKind.UserDefinedOperator, "op_Inequality"), 374New BaseLine(MethodKind.Conversion, "op_Explicit"), 375New BaseLine(MethodKind.Conversion, "op_Implicit"), 376New BaseLine(MethodKind.Conversion, "op_Explicit"), 377New BaseLine(MethodKind.UserDefinedOperator, "op_LeftShift"), 378New BaseLine(MethodKind.UserDefinedOperator, "op_RightShift"), 379New BaseLine(MethodKind.UserDefinedOperator, "op_ExclusiveOr") 528New BaseLine(MethodKind.UserDefinedOperator, "op_UnaryPlus"), 529New BaseLine(MethodKind.UserDefinedOperator, "op_UnaryNegation"), 530New BaseLine(MethodKind.UserDefinedOperator, "op_OnesComplement"), 531New BaseLine(MethodKind.UserDefinedOperator, "op_True"), 532New BaseLine(MethodKind.UserDefinedOperator, "op_False"), 533New BaseLine(MethodKind.UserDefinedOperator, "op_Addition"), 534New BaseLine(MethodKind.UserDefinedOperator, "op_Subtraction"), 535New BaseLine(MethodKind.UserDefinedOperator, "op_Multiply"), 536New BaseLine(MethodKind.UserDefinedOperator, "op_Division"), 537New BaseLine(MethodKind.Conversion, "op_Implicit"), 538New BaseLine(MethodKind.Conversion, "op_Explicit")
SymbolsTests\Source\PropertyTests.vb (20)
5600VerifyAccessor(goodStatic.GetMethod, goodStatic, MethodKind.PropertyGet) 5601VerifyAccessor(goodStatic.SetMethod, goodStatic, MethodKind.PropertySet) 5602VerifyAccessor(badStatic.GetMethod, goodStatic, MethodKind.PropertyGet) 5603VerifyAccessor(badStatic.SetMethod, goodStatic, MethodKind.PropertySet) 5604VerifyAccessor(mismatchedStatic.GetMethod, goodStatic, MethodKind.PropertyGet) 5605VerifyAccessor(mismatchedStatic.SetMethod, mismatchedStatic, MethodKind.PropertySet) 5617VerifyAccessor(goodInstance.GetMethod, goodInstance, MethodKind.PropertyGet) 5618VerifyAccessor(goodInstance.SetMethod, goodInstance, MethodKind.PropertySet) 5619VerifyAccessor(badInstance.GetMethod, goodInstance, MethodKind.PropertyGet) 5620VerifyAccessor(badInstance.SetMethod, goodInstance, MethodKind.PropertySet) 5621VerifyAccessor(mismatchedInstance.GetMethod, goodInstance, MethodKind.PropertyGet) 5622VerifyAccessor(mismatchedInstance.SetMethod, mismatchedInstance, MethodKind.PropertySet) 5626VerifyAccessor(staticAndInstance.GetMethod, goodStatic, MethodKind.PropertyGet) 5627VerifyAccessor(staticAndInstance.SetMethod, goodInstance, MethodKind.PropertySet) 5632VerifyAccessor(getUsedAsSet.GetMethod, goodInstance, MethodKind.PropertyGet) 5633VerifyAccessor(getUsedAsSet.SetMethod, goodInstance, MethodKind.PropertyGet) 8110Dim isAccessor = accessor.MethodKind = MethodKind.PropertyGet OrElse accessor.MethodKind = MethodKind.PropertySet 8165Private Sub VerifyAccessor(accessor As MethodSymbol, associatedProperty As PEPropertySymbol, methodKind As MethodKind) 8170Dim method = If((methodKind = MethodKind.PropertyGet), associatedProperty.GetMethod, associatedProperty.SetMethod)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (5)
BasicTrackingDiagnosticAnalyzer.vb (3)
14Protected Overrides Function IsOnCodeBlockSupported(symbolKind As SymbolKind, methodKind As MethodKind, returnsVoid As Boolean) As Boolean 16methodKind <> MethodKind.Destructor AndAlso 17methodKind <> MethodKind.ExplicitInterfaceImplementation
MockSymbols.vb (2)
582Public Overrides ReadOnly Property MethodKind As MethodKind 584Return MethodKind.Ordinary
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)
124Function(s) If(TryCast(s, IMethodSymbol)?.MethodKind = MethodKind.Ordinary, False))
Recommendations\VisualBasicRecommendationServiceRunner.vb (2)
343symbols = symbols.WhereAsArray(Function(s) s.Kind <> SymbolKind.Method OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.UserDefinedOperator) 382If method IsNot Nothing AndAlso method.MethodKind = MethodKind.Constructor Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
159methodSymbol?.MethodKind = MethodKind.Ordinary AndAlso 397If method.MethodKind = MethodKind.ReducedExtension AndAlso
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
153If method.MethodKind = MethodKind.UserDefinedOperator Then 157If method.MethodKind = MethodKind.Conversion Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (1)
19If symbol.IsStatic AndAlso Not symbol.MethodKind = MethodKind.ReducedExtension Then
Microsoft.CodeAnalysis.Workspaces (158)
Editing\SyntaxGenerator.cs (12)
280if (method.MethodKind is not (MethodKind.UserDefinedOperator or MethodKind.Conversion)) 737case MethodKind.Constructor: 738case MethodKind.SharedConstructor: 741case MethodKind.Destructor: 744case MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation: 747case MethodKind.UserDefinedOperator or MethodKind.Conversion: 834case MethodKind.Constructor: 835case MethodKind.SharedConstructor: 837case MethodKind.Ordinary:
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (1)
19=> symbol.MethodKind == MethodKind.Constructor;
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (3)
25=> symbol.MethodKind is MethodKind.Constructor or MethodKind.StaticConstructor; 64if (symbol.MethodKind == MethodKind.Constructor)
FindSymbols\FindReferences\Finders\DestructorSymbolReferenceFinder.cs (1)
16=> symbol.MethodKind == MethodKind.Destructor;
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
20=> symbol is { MethodKind: MethodKind.Conversion, Name: WellKnownMemberNames.ExplicitConversionName or WellKnownMemberNames.ImplicitConversionName } &&
FindSymbols\FindReferences\Finders\ExplicitInterfaceMethodReferenceFinder.cs (1)
16=> symbol.MethodKind == MethodKind.ExplicitInterfaceImplementation;
FindSymbols\FindReferences\Finders\OperatorSymbolReferenceFinder.cs (2)
18=> symbol.MethodKind is MethodKind.UserDefinedOperator or MethodKind.BuiltinOperator;
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (5)
16=> symbol.MethodKind is MethodKind.Ordinary or 17MethodKind.DelegateInvoke or 18MethodKind.DeclareMethod or 19MethodKind.ReducedExtension or 20MethodKind.LocalFunction;
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (2)
175if (declaredSymbol is IMethodSymbol { MethodKind: not MethodKind.AnonymousFunction }) 213if (containingMethod.MethodKind == MethodKind.DelegateInvoke)
FindSymbols\ReferenceLocationExtensions.cs (1)
95if (method.MethodKind != MethodKind.AnonymousFunction)
ReassignedVariable\AbstractReassignedVariableService.cs (2)
184if (methodOrProperty is IMethodSymbol { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet } method)
Recommendations\AbstractRecommendationService.cs (5)
89case MethodKind.EventAdd: 90case MethodKind.EventRemove: 91case MethodKind.EventRaise: 92case MethodKind.PropertyGet: 93case MethodKind.PropertySet:
Recommendations\AbstractRecommendationServiceRunner.cs (1)
68if (parameter.ContainingSymbol is not IMethodSymbol { MethodKind: MethodKind.AnonymousFunction } owningMethod)
Rename\RenameUtilities.cs (3)
367if (methodSymbol.MethodKind is MethodKind.Constructor or 368MethodKind.StaticConstructor or 369MethodKind.Destructor)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (3)
210MethodKind: MethodKind.Constructor or MethodKind.StaticConstructor or MethodKind.Destructor,
Shared\Extensions\ISymbolExtensions.cs (2)
475if (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)
52methodSymbol.MethodKind == MethodKind.BuiltinOperator &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (1)
50if (symbol.MethodKind == MethodKind.BuiltinOperator)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (5)
226if (member is IMethodSymbol { IsStatic: true, IsAbstract: true, MethodKind: MethodKind.UserDefinedOperator } method) 426if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } || 427method is { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true }) 637IMethodSymbol { MethodKind: MethodKind.Ordinary, CanBeReferencedByName: true } => true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (2)
30MethodKind: MethodKind.Constructor, 62MethodKind: MethodKind.Constructor,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (19)
138if (methodSymbol.MethodKind is MethodKind.Ordinary or 139MethodKind.PropertyGet or 140MethodKind.PropertySet or 141MethodKind.UserDefinedOperator or 142MethodKind.Conversion) 178=> symbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }; 205=> symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }; 214=> symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }; 223=> symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }; 226=> symbol is IMethodSymbol { MethodKind: MethodKind.StaticConstructor }; 229=> symbol is IMethodSymbol { MethodKind: MethodKind.Destructor }; 232=> symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }; 235=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion }; 238=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary }; 241=> symbol is IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction }; 553=> symbol is IMethodSymbol { MethodKind: MethodKind.EventAdd or MethodKind.EventRaise or MethodKind.EventRemove };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (1)
153if (symbol is IMethodSymbol { MethodKind: MethodKind.BuiltinOperator })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\MethodKindExtensions.cs (3)
9public static bool IsPropertyAccessor(this MethodKind kind) 10=> kind is MethodKind.PropertyGet or MethodKind.PropertySet;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (3)
326case MethodKind.AnonymousFunction: 327case MethodKind.DelegateInvoke: 339case MethodKind.LocalFunction:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
130private static readonly SymbolKindOrTypeKind _method = new(MethodKind.Ordinary); 131private static readonly SymbolKindOrTypeKind _localFunction = new(MethodKind.LocalFunction); 365case MethodKind.Ordinary: 368case MethodKind.LocalFunction:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
48return method.MethodKind is MethodKind.Ordinary or 49MethodKind.LocalFunction;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (18)
75new SymbolKindOrTypeKind(MethodKind.Ordinary), 76new SymbolKindOrTypeKind(MethodKind.LocalFunction), 174case MethodKind.AnonymousFunction: 175case MethodKind.LocalFunction: 303foreach (var methodKindElement in symbolKindListElement.Elements(nameof(MethodKind))) 354public SymbolKindOrTypeKind(MethodKind methodKind) 361public MethodKind? MethodKind => (_category == SymbolCategory.Method) ? (MethodKind)_kind : null; 368SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind, 377SymbolCategory.Method => new XElement(nameof(MethodKind), GetMethodKindString((MethodKind)_kind)), 393private static string GetMethodKindString(MethodKind methodKind) 400CodeAnalysis.MethodKind.SharedConstructor => nameof(CodeAnalysis.MethodKind.StaticConstructor), 401CodeAnalysis.MethodKind.AnonymousFunction => nameof(CodeAnalysis.MethodKind.LambdaMethod), 432CodeAnalysis.SymbolKind.Method => new(CodeAnalysis.MethodKind.Ordinary), 441=> new((MethodKind)Enum.Parse(typeof(MethodKind), methodKindElement.Value));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
113methodSymbol.MethodKind == MethodKind.UserDefinedOperator;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
73/// cref="IRangeVariableSymbol"/> and <see cref="MethodKind.LocalFunction"/> <see cref="IMethodSymbol"/>s can also 319IMethodSymbol { MethodKind: MethodKind.LocalFunction } => true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
144if (symbol.MethodKind == MethodKind.Conversion)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (4)
370case MethodKind.AnonymousFunction: 375case MethodKind.BuiltinOperator: 380case MethodKind.ReducedExtension: 385case MethodKind.LocalFunction:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (5)
407if (methodSymbol.MethodKind == MethodKind.LocalFunction && newMethodSymbol.MethodKind == MethodKind.LocalFunction) 477if (symbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } methodSymbol && 478newSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction } newMethodSymbol) 879((IMethodSymbol)symbol).MethodKind == MethodKind.DelegateInvoke;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (3)
77if ((method1.MethodKind == MethodKind.AnonymousFunction) != 78(method2.MethodKind == MethodKind.AnonymousFunction)) 83if (method1.MethodKind != MethodKind.AnonymousFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (2)
200if (x is { MethodKind: MethodKind.DelegateInvoke, ContainingType.IsAnonymousType: true }) 205if (x.MethodKind == MethodKind.FunctionPointerSignature)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (11)
176if (x.MethodKind == MethodKind.ReducedExtension) 195if (x.MethodKind is MethodKind.AnonymousFunction or 196MethodKind.LocalFunction) 248private static bool AreCompatibleMethodKinds(MethodKind kind1, MethodKind kind2) 255if ((kind1 == MethodKind.Ordinary && kind2.IsPropertyAccessor()) || 256(kind1.IsPropertyAccessor() && kind2 == MethodKind.Ordinary)) 262if ((kind1 == MethodKind.BuiltinOperator && kind2 == MethodKind.UserDefinedOperator) || 263(kind1 == MethodKind.UserDefinedOperator && kind2 == MethodKind.BuiltinOperator))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
112if (x.MethodKind == MethodKind.AnonymousFunction)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (4)
165MethodKind methodKind = MethodKind.Ordinary, 186MethodKind methodKind = MethodKind.Ordinary,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
77public virtual MethodKind MethodKind => MethodKind.Ordinary;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (2)
34public override MethodKind MethodKind => MethodKind.Constructor;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (2)
41public override MethodKind MethodKind => MethodKind.Conversion;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (2)
25public override MethodKind MethodKind => MethodKind.Destructor;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (5)
25public override MethodKind MethodKind { get; } 40MethodKind methodKind = MethodKind.Ordinary, 47Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet); 48this.IsInitOnly = methodKind == MethodKind.PropertySet && isInitOnly;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (2)
174this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor && !m.IsStatic)); 184this.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.StaticConstructor && m.IsStatic));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (2)
40public override MethodKind MethodKind => MethodKind.UserDefinedOperator;
Microsoft.CodeAnalysis.Workspaces.UnitTests (16)
CodeStyle\NamingStylePreferencesUpgradeTests.cs (5)
191[InlineData(typeof(MethodKind), nameof(MethodKind.AnonymousFunction), nameof(MethodKind.LambdaMethod), nameof(MethodKind.SharedConstructor), nameof(MethodKind.StaticConstructor))]
EditorConfigParsing\NamingStyleParserTests.cs (3)
162symbolKind => Assert.Equal(new SymbolKindOrTypeKind(MethodKind.Ordinary), symbolKind), 163symbolKind => Assert.Equal(new SymbolKindOrTypeKind(MethodKind.LocalFunction), symbolKind), 240symbolKind => Assert.Equal(new SymbolKindOrTypeKind(MethodKind.LocalFunction), symbolKind));
UtilityTest\DocumentationCommentIdTests.cs (8)
155CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#cctor", compilation, s => s.MethodKind == MethodKind.StaticConstructor); 156CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#ctor", compilation, s => s.MethodKind == MethodKind.Constructor && s.Parameters.Length == 0); 157CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.#ctor(System.String)", compilation, s => s.MethodKind == MethodKind.Constructor && s.Parameters.Length == 1); 174CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.Finalize", compilation, s => s.MethodKind == MethodKind.Destructor); 281CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_UnaryPlus(Acme.Widget)", compilation, m => m.MethodKind == MethodKind.UserDefinedOperator && m.Parameters.Length == 1); 297CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Addition(Acme.Widget,Acme.Widget)", compilation, m => m.MethodKind == MethodKind.UserDefinedOperator && m.Parameters.Length == 2); 314CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Explicit(Acme.Widget)~System.Int32", compilation, m => m.MethodKind == MethodKind.Conversion && m.Parameters.Length == 1 && m.ReturnType.Name == "Int32"); 315CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Implicit(Acme.Widget)~System.Int64", compilation, m => m.MethodKind == MethodKind.Conversion && m.Parameters.Length == 1 && m.ReturnType.Name == "Int64");
Microsoft.Gen.Logging (1)
Parsing\Parser.Records.cs (1)
73if (m is not IMethodSymbol { MethodKind: MethodKind.Constructor } ctorMethod)
Microsoft.Interop.ComInterfaceGenerator (2)
ComMethodInfo.cs (2)
58case IMethodSymbol { MethodKind: MethodKind.Ordinary }: 89Debug.Assert(method is { IsStatic: false, MethodKind: MethodKind.Ordinary });
Microsoft.VisualStudio.LanguageServices (23)
Implementation\VsRefactorNotifyService.cs (2)
165if (methodSymbol.MethodKind is MethodKind.Constructor or 166MethodKind.Destructor)
Library\ObjectBrowser\AbstractListItemFactory.cs (2)
346if (methodSymbol.MethodKind is MethodKind.Destructor or MethodKind.Constructor ||
Library\ObjectBrowser\Lists\MemberListItem.cs (2)
42Kind = methodSymbol.MethodKind is MethodKind.Conversion or 43MethodKind.UserDefinedOperator
Progression\GraphBuilder.cs (14)
386if (methodSymbol.MethodKind == MethodKind.Constructor) 390else if (methodSymbol.MethodKind == MethodKind.StaticConstructor) 394else if (methodSymbol.MethodKind == MethodKind.Destructor) 522case MethodKind.AnonymousFunction: 526case MethodKind.BuiltinOperator: 527case MethodKind.UserDefinedOperator: 531case MethodKind.Constructor: 532case MethodKind.StaticConstructor: 536case MethodKind.Conversion: 541case MethodKind.Destructor: 545case MethodKind.PropertyGet: 549case MethodKind.PropertySet: 624var isOperator = method.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion;
Progression\GraphNodeIdCreation.cs (1)
322if (member is IMethodSymbol methodSymbol && methodSymbol.MethodKind == MethodKind.Conversion)
Progression\GraphQueries\CallsGraphQuery.cs (1)
55(newSymbol.CanBeReferencedByName || ((IMethodSymbol)newSymbol).MethodKind == MethodKind.Constructor))
Progression\RoslynGraphProperties.cs (1)
85dataType: typeof(MethodKind),
Microsoft.VisualStudio.LanguageServices.CSharp (37)
CodeModel\CSharpCodeModelService.cs (27)
996if (methodSymbol.MethodKind is MethodKind.PropertyGet or 997MethodKind.PropertySet or 998MethodKind.EventAdd or 999MethodKind.EventRemove or 1000MethodKind.EventRaise) 1491public override MethodKind GetAccessorKind(SyntaxNode node) 1494SyntaxKind.GetAccessorDeclaration => MethodKind.PropertyGet, 1495SyntaxKind.SetAccessorDeclaration => MethodKind.PropertySet, 1496SyntaxKind.AddAccessorDeclaration => MethodKind.EventAdd, 1497SyntaxKind.RemoveAccessorDeclaration => MethodKind.EventRemove, 1501private static SyntaxKind GetAccessorSyntaxKind(MethodKind methodKind) 1504MethodKind.PropertyGet => SyntaxKind.GetAccessorDeclaration, 1505MethodKind.PropertySet => SyntaxKind.SetAccessorDeclaration, 1506MethodKind.EventAdd => SyntaxKind.AddAccessorDeclaration, 1507MethodKind.EventRemove => SyntaxKind.RemoveAccessorDeclaration, 1511public override bool TryGetAccessorNode(SyntaxNode parentNode, MethodKind kind, [NotNullWhen(true)] out SyntaxNode? accessorNode) 2190case MethodKind.Ordinary: 2191case MethodKind.ExplicitInterfaceImplementation: 2194case MethodKind.Constructor: 2195case MethodKind.StaticConstructor: 2198case MethodKind.Destructor: 2201case MethodKind.UserDefinedOperator: 2202case MethodKind.Conversion: 2205case MethodKind.PropertyGet: 2206case MethodKind.EventRemove: 2209case MethodKind.PropertySet: 2210case MethodKind.EventAdd:
LanguageService\CSharpHelpContextService.cs (1)
199if (symbol is IMethodSymbol method && method.MethodKind == MethodKind.BuiltinOperator)
ObjectBrowser\DescriptionBuilder.cs (7)
194if (methodSymbol.MethodKind is not MethodKind.Constructor and 195not MethodKind.Destructor and 196not MethodKind.StaticConstructor and 197not MethodKind.Conversion) 203if (methodSymbol.MethodKind == MethodKind.Conversion) 253methodSymbol.MethodKind == MethodKind.Destructor) 268methodSymbol.MethodKind != MethodKind.StaticConstructor)
Progression\CSharpProgressionLanguageService.cs (2)
127=> f.MethodKind is MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation;
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (7)
GlyphExtensionsTests.cs (7)
47methodKind: MethodKind.ReducedExtension); 154methodKind: MethodKind.UserDefinedOperator); 163methodKind: MethodKind.Conversion); 180MethodKind methodKind = MethodKind.Ordinary, 197MethodKind methodKind = MethodKind.Ordinary,
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
238Dim extractableMembers = DirectCast(symbol, INamedTypeSymbol).GetMembers().Where(Function(s) Not (TypeOf s Is IMethodSymbol) OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.Constructor)
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
301Dim extractableMembers = DirectCast(symbol, INamedTypeSymbol).GetMembers().Where(Function(s) Not (TypeOf s Is IMethodSymbol) OrElse DirectCast(s, IMethodSymbol).MethodKind <> MethodKind.Constructor)
Microsoft.VisualStudio.LanguageServices.VisualBasic (33)
CodeModel\VisualBasicCodeModelService.vb (28)
1096Public Overrides Function GetAccessorKind(node As SyntaxNode) As MethodKind 1099Return MethodKind.PropertyGet 1101Return MethodKind.PropertySet 1103Return MethodKind.EventAdd 1105Return MethodKind.EventRemove 1107Return MethodKind.EventRaise 1113Private Overloads Shared Function GetAccessorKind(methodKind As MethodKind) As SyntaxKind 1115Case MethodKind.PropertyGet 1117Case MethodKind.PropertySet 1119Case MethodKind.EventAdd 1121Case MethodKind.EventRemove 1123Case MethodKind.EventRaise 1141Public Overrides Function TryGetAccessorNode(parentNode As SyntaxNode, kind As MethodKind, ByRef accessorNode As SyntaxNode) As Boolean 1387If methodSymbol.MethodKind = MethodKind.PropertyGet OrElse 1388methodSymbol.MethodKind = MethodKind.PropertySet OrElse 1389methodSymbol.MethodKind = MethodKind.EventAdd OrElse 1390methodSymbol.MethodKind = MethodKind.EventRemove OrElse 1391methodSymbol.MethodKind = MethodKind.EventRaise Then 2544Case MethodKind.Ordinary, 2545MethodKind.DeclareMethod 2548Case MethodKind.Constructor, 2549MethodKind.StaticConstructor 2552Case MethodKind.UserDefinedOperator 2555Case MethodKind.PropertyGet 2557Case MethodKind.PropertySet 2560Case MethodKind.EventAdd 2562Case MethodKind.EventRemove 2564Case MethodKind.EventRaise
CodeModel\VisualBasicCodeModelService_Prototype.vb (1)
96If methodSymbol.MethodKind = MethodKind.Ordinary AndAlso
ObjectBrowser\DescriptionBuilder.vb (4)
116Case MethodKind.Conversion, MethodKind.UserDefinedOperator 118Case MethodKind.DeclareMethod 341(methodSymbol Is Nothing OrElse Not methodSymbol.MethodKind = MethodKind.DeclareMethod) AndAlso