27 overrides of MethodKind
Microsoft.CodeAnalysis.CSharp (24)
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (1)
70public override MethodKind MethodKind
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ConstructorSymbol.cs (1)
43public override MethodKind MethodKind
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.EqualsMethodSymbol.cs (1)
28public override MethodKind MethodKind
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.GetHashCodeMethodSymbol.cs (1)
32public override MethodKind MethodKind
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertyAccessorSymbol.cs (1)
29public override MethodKind MethodKind
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ToStringMethodSymbol.cs (1)
32public override MethodKind MethodKind
Symbols\ErrorMethodSymbol.cs (1)
199public override MethodKind MethodKind
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
769public override MethodKind MethodKind => MethodKind.FunctionPointerSignature;
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1056public override MethodKind MethodKind
Symbols\ReducedExtensionMethodSymbol.cs (1)
459public override MethodKind MethodKind
Symbols\SignatureOnlyMethodSymbol.cs (1)
93public override MethodKind MethodKind { get { return _methodKind; } }
Symbols\Source\LambdaSymbol.cs (1)
72public override MethodKind MethodKind
Symbols\Source\LocalFunctionSymbol.cs (1)
294public override MethodKind MethodKind => MethodKind.LocalFunction;
Symbols\Source\SourceMemberMethodSymbol.cs (1)
426public sealed override MethodKind MethodKind
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (1)
93public override MethodKind MethodKind
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (1)
151public override MethodKind MethodKind
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
238public override MethodKind MethodKind
Symbols\Synthesized\SynthesizedImplementationMethod.cs (1)
138public override MethodKind MethodKind
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
188public sealed override MethodKind MethodKind
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
129public override MethodKind MethodKind
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
66public override MethodKind MethodKind
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (1)
133public override MethodKind MethodKind
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
189public override MethodKind MethodKind
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
280public override MethodKind MethodKind
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (3)
Symbols\EEMethodSymbol.cs (1)
233public override MethodKind MethodKind
Symbols\PlaceholderMethodSymbol.cs (1)
134public override MethodKind MethodKind
Symbols\SynthesizedContextMethodSymbol.cs (1)
110public override MethodKind MethodKind
560 references to MethodKind
Microsoft.CodeAnalysis.CSharp (191)
Binder\Binder.ValueChecks.cs (5)
1218canModifyReadonly = (containingMethod.MethodKind == desiredMethodKind) || 1679if (method.MethodKind == MethodKind.Constructor || method.IsInitOnly) 2261if (method.MethodKind == MethodKind.Constructor) 4794return containingSymbol is MethodSymbol { MethodKind: MethodKind.StaticConstructor } or FieldSymbol { IsStatic: true }; 4798return (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 (1)
776MethodKind candidateMethodKind = candidateMethod.MethodKind;
Binder\Binder_Expressions.cs (8)
1788return (containingMethod.MethodKind == MethodKind.AnonymousFunction || containingMethod.MethodKind == MethodKind.LocalFunction) && !IsInsideNameof; // false in EE evaluation method 1918(this.ContainingMember() is MethodSymbol { MethodKind: MethodKind.Constructor } containingMember && (object)containingMember != primaryCtor)) && // We are in a non-primary instance constructor 1948this.ContainingMemberOrLambda is MethodSymbol { MethodKind: MethodKind.AnonymousFunction or MethodKind.LocalFunction } && 4115Debug.Assert(constructor.MethodKind == MethodKind.Constructor || 4116constructor.MethodKind == MethodKind.StaticConstructor); // error scenario: constructor initializer on static constructor 5599Debug.Assert(constructor.MethodKind == MethodKind.Constructor || constructor.MethodKind == MethodKind.StaticConstructor);
Binder\Binder_Statements.cs (2)
1786return (member as MethodSymbol)?.MethodKind == (isStatic ? 3706if (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\MethodGroupResolution.cs (1)
88MethodGroup.Methods[0].MethodKind == MethodKind.LocalFunction;
Binder\Semantics\AccessCheck.cs (1)
196case SymbolKind.Method when ((MethodSymbol)symbol).MethodKind == MethodKind.LocalFunction:
BoundTree\BoundNodeExtensions.cs (1)
62return method.MethodKind == MethodKind.Constructor &&
CodeGen\EmitExpression.cs (1)
1966if (method.IsEffectivelyReadOnly && method.MethodKind != MethodKind.Constructor)
Compilation\CSharpCompilation.cs (1)
2811if (symbol.Kind == SymbolKind.Method && symbol.IsImplicitlyDeclared && ((MethodSymbol)symbol).MethodKind == MethodKind.Constructor)
Compilation\CSharpSemanticModel.cs (2)
1784case MethodSymbol { MethodKind: MethodKind.LambdaMethod }: 4764if (call.InvokedAsExtensionMethod && method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension)
Compilation\MemberSemanticModel.cs (1)
2306Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod });
Compilation\MethodBodySemanticModel.cs (1)
243if (MemberSymbol is MethodSymbol methodSymbol && methodSymbol.MethodKind == MethodKind.Constructor &&
Compilation\SyntaxTreeSemanticModel.cs (1)
2381Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod });
Compiler\ClsComplianceChecker.cs (1)
729if (method.MethodKind == MethodKind.DelegateInvoke)
Compiler\MethodBodySynthesizer.cs (1)
526Debug.Assert(method.MethodKind == MethodKind.Destructor);
Compiler\MethodCompiler.cs (7)
521(method.MethodKind == MethodKind.Constructor || method.IsScriptInitializer) ? processedInstanceInitializers : 522method.MethodKind == MethodKind.StaticConstructor ? processedStaticInitializers : 1122if ((methodSymbol.MethodKind == MethodKind.Constructor || methodSymbol.MethodKind == MethodKind.StaticConstructor) && 1800if (method.MethodKind == MethodKind.StaticConstructor && 1973if (method.MethodKind == MethodKind.Destructor && body != null) 2276if (method.MethodKind == MethodKind.Constructor && !method.IsExtern)
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (1)
116if (symbol.MethodKind == MethodKind.Conversion)
Emitter\Model\MethodSymbolAdapter.cs (5)
385return AdaptedMethodSymbol.MethodKind == MethodKind.Constructor; 634return this.MethodKind == MethodKind.Constructor 635|| this.MethodKind == MethodKind.StaticConstructor; 644Debug.Assert(this.MethodKind != MethodKind.Destructor); 648!(this.IsVirtual || this.IsOverride || this.IsAbstract || this.MethodKind == MethodKind.Destructor));
Emitter\Model\NamedTypeSymbolAdapter.cs (3)
355else if (method.MethodKind == MethodKind.Destructor && AdaptedNamedTypeSymbol.SpecialType != SpecialType.System_Object) 366if ((object)objectMethod != null && objectMethod.MethodKind == MethodKind.Destructor) 621if ((alwaysIncludeConstructors && method.MethodKind == MethodKind.Constructor) || method.GetCciAdapter().ShouldInclude(context))
Emitter\NoPia\EmbeddedMethod.cs (1)
70return UnderlyingMethod.AdaptedMethodSymbol.MethodKind == MethodKind.Constructor;
FlowAnalysis\AbstractFlowPass.cs (2)
1334if (method is null || method.MethodKind != MethodKind.Constructor) 1431Debug.Assert(method?.OriginalDefinition.MethodKind != MethodKind.LocalFunction);
FlowAnalysis\DefiniteAssignment.cs (6)
103&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1214Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1261if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 2207(currentMethod.MethodKind == MethodKind.AnonymousFunction || 2208currentMethod.MethodKind == MethodKind.LocalFunction) && 2250if (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); 112Debug.Assert(method.MethodKind == MethodKind.Constructor);
FlowAnalysis\NullableWalker.cs (5)
433Debug.Assert(baseOrThisInitializer is null or { MethodKind: MethodKind.Constructor }); 1413return constructorBody is BoundConstructorMethodBody { Initializer: BoundExpressionStatement { Expression: BoundCall { Method: { MethodKind: MethodKind.Constructor } initializerMethod } } } 2084while (enclosingMemberMethod?.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 5723|| method.MethodKind != MethodKind.Ordinary 7340if (((MethodSymbol)symbol).MethodKind == MethodKind.LocalFunction)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (2)
442if (node.Method.MethodKind == MethodKind.LocalFunction) 452if (node.MethodOpt?.MethodKind == MethodKind.LocalFunction)
Lowering\ClosureConversion\ClosureConversion.cs (10)
185_seenBaseCall = method.MethodKind != MethodKind.Constructor; // only used for ctors 201(localOrParameter as MethodSymbol)?.MethodKind == MethodKind.LocalFunction); 429originalMethod.MethodKind == MethodKind.LambdaMethod && 774if (_currentMethod.MethodKind == MethodKind.Constructor && 843var loweredSymbol = (node.Method.MethodKind is MethodKind.LambdaMethod or MethodKind.LocalFunction) ? 861Debug.Assert(localFunc.MethodKind == MethodKind.LocalFunction); 1056if (node.Method.MethodKind == MethodKind.LocalFunction) 1322if (node.MethodOpt?.MethodKind == MethodKind.LocalFunction) 1348if (node.TargetMethod.MethodKind == MethodKind.LocalFunction) 1645_currentMethod.MethodKind != MethodKind.StaticConstructor &&
Lowering\DiagnosticsPass_ExpressionTrees.cs (4)
186var diagnostic = _staticLocalOrAnonymousFunction.MethodKind == MethodKind.LocalFunction 201var diagnostic = _staticLocalOrAnonymousFunction.MethodKind == MethodKind.LocalFunction 332else if (method.MethodKind == MethodKind.LocalFunction) 808if ((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\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 || 217if (conversion.Method.MethodKind == MethodKind.LocalFunction) 241node.MethodOpt?.MethodKind == MethodKind.LocalFunction;
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
431var requiresInstanceReceiver = methodOrIndexer.RequiresInstanceReceiver() && methodOrIndexer is not MethodSymbol { MethodKind: MethodKind.Constructor } and not FunctionPointerMethodSymbol;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
572&& _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 (2)
165switch (constructionMethod.MethodKind) 198throw ExceptionUtilities.UnexpectedValue(constructionMethod.MethodKind);
Lowering\SyntheticBoundNodeFactory.cs (4)
70value.MethodKind != MethodKind.AnonymousFunction && 71value.MethodKind != MethodKind.LocalFunction) 188CurrentFunction.MethodKind == MethodKind.AnonymousFunction || 189CurrentFunction.MethodKind == MethodKind.LocalFunction ||
Symbols\Compilation_WellKnownMembers.cs (1)
303MethodKind methodKind = method.MethodKind;
Symbols\MemberSymbolExtensions.cs (6)
173return methodSymbol.MethodKind == MethodKind.UserDefinedOperator || methodSymbol.MethodKind == MethodKind.Conversion; 193return symbol.Kind == SymbolKind.Method && ((MethodSymbol)symbol).MethodKind == MethodKind.Conversion; 360switch (method.MethodKind) 375if ((object)method != null && method.MethodKind == MethodKind.Constructor) 440return method.MethodKind == MethodKind.Constructor && method.ParameterCount == 0;
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1276method.MethodKind == MethodKind.Destructor);
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
868case "" when !ContainingSymbol.RequiresInstanceReceiver() || ContainingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.DelegateInvoke }:
Symbols\MethodSymbol.cs (9)
365protected bool IsValidReadOnlyTarget => !IsStatic && ContainingType.IsStructType() && MethodKind != MethodKind.Constructor && !IsInitOnly; 585internal bool HasSetsRequiredMembers => MethodKind == MethodKind.Constructor && HasSetsRequiredMembersImpl; 651return MethodKind == MethodKind.Constructor && ContainingType.IsScriptClass; 667return ((MethodKind == MethodKind.Constructor || MethodKind == MethodKind.StaticConstructor) && IsImplicitlyDeclared); 678return MethodKind == MethodKind.Constructor && IsImplicitlyDeclared; 748if (!this.IsExtensionMethod || this.MethodKind == MethodKind.ReducedExtension || receiverType.IsVoidType()) 762return (this.IsExtensionMethod && this.MethodKind != MethodKind.ReducedExtension) ? ReducedExtensionMethodSymbol.Create(this) : null; 1030if (!IsStatic || IsAbstract || IsVirtual || MethodKind is not (MethodKind.Ordinary or MethodKind.LocalFunction))
Symbols\MethodSymbolExtensions.cs (5)
24return method.IsImplicitlyDeclared && method.MethodKind == MethodKind.AnonymousFunction; 53if (!skipFirstMethodKindCheck && method.MethodKind == MethodKind.Destructor) 100if (hiddenMethod.MethodKind == MethodKind.Destructor) 126switch (method.MethodKind) 220method.MethodKind is (MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet) &&
Symbols\NamedTypeSymbol.cs (5)
223if (candidate.MethodKind == MethodKind.UserDefinedOperator || candidate.MethodKind == MethodKind.Conversion) 286Debug.Assert(method.MethodKind == MethodKind.Constructor); 294Debug.Assert(method.MethodKind == MethodKind.StaticConstructor); 373Debug.Assert(method.MethodKind != MethodKind.ReducedExtension);
Symbols\NativeIntegerTypeSymbol.cs (1)
94switch (underlyingMethod.MethodKind)
Symbols\OverriddenOrHiddenMembersHelpers.cs (3)
246bool accessorIsGetter = accessor.MethodKind == MethodKind.PropertyGet; 338bool accessorIsAdder = accessor.MethodKind == MethodKind.EventAdd; 881return MethodSymbol.CanOverrideOrHide(methodSymbol.MethodKind) && ReferenceEquals(methodSymbol, methodSymbol.ConstructedFrom);
Symbols\PublicModel\MethodSymbol.cs (2)
36switch (_underlying.MethodKind) 73throw ExceptionUtilities.UnexpectedValue(_underlying.MethodKind);
Symbols\ReducedExtensionMethodSymbol.cs (2)
39Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 74Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
1041method.MethodKind,
Symbols\Source\ExplicitInterfaceHelpers.cs (2)
97if (method.MethodKind != MethodKind.ExplicitInterfaceImplementation) 263(interfaceMethod.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion) != isOperator)
Symbols\Source\ParameterHelpers.cs (3)
208Debug.Assert(methodOwner?.MethodKind != MethodKind.LambdaMethod); 210methodOwner?.MethodKind == MethodKind.LocalFunction; 879if (method.MethodKind != MethodKind.AnonymousFunction)
Symbols\Source\SourceComplexParameterSymbol.cs (1)
1336if (!ContainingSymbol.RequiresInstanceReceiver() || ContainingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.DelegateInvoke or MethodKind.LambdaMethod })
Symbols\Source\SourceMemberContainerSymbol.cs (9)
2337if (member.Kind != SymbolKind.Method || ((MethodSymbol)member).MethodKind != MethodKind.Destructor) 3602if ((methodSymbol.MethodKind == MethodKind.Ordinary) && 3638if ((methodSymbol.MethodKind == MethodKind.Ordinary) && 3791switch (meth.MethodKind) 3814throw ExceptionUtilities.UnexpectedValue(meth.MethodKind); 3839if (m.MethodKind == MethodKind.Constructor && m.ParameterCount == 0) 3881if (hasInitializers && !builder.NonTypeMembers.Any(member => member is MethodSymbol { MethodKind: MethodKind.Constructor })) 3933case MethodSymbol { MethodKind: not (MethodKind.Ordinary or MethodKind.Constructor) }: 4533switch (method.MethodKind)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (3)
536if (MethodSymbol.CanOverrideOrHide(method.MethodKind) && !method.IsAccessor()) 552else if (method.MethodKind == MethodKind.Destructor) 891!(overridingMemberIsMethod && ((MethodSymbol)overriddenMember).MethodKind == MethodKind.Destructor)) //destructors are metadata virtual
Symbols\Source\SourceMethodSymbolWithAttributes.cs (10)
145switch (MethodKind) 674else if (!this.CanBeReferencedByName || this.MethodKind == MethodKind.Destructor) 689else if (this is { MethodKind: MethodKind.LocalFunction, IsStatic: false }) 888if (MethodKind != MethodKind.Ordinary) 1032switch (this.MethodKind) 1062var errorCode = (this.MethodKind == MethodKind.Constructor || this.MethodKind == MethodKind.StaticConstructor) ? 1114if (this.MethodKind != MethodKind.LambdaMethod) 1216switch (this.MethodKind) 1298if (this.ContainingType.IsComImport && this.MethodKind == MethodKind.Constructor)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1687|| GetMembers().All(m => m is not MethodSymbol { MethodKind: MethodKind.Constructor, ObsoleteKind: ObsoleteAttributeKind.None } method
Symbols\Source\SourcePropertySymbolBase.cs (1)
957Debug.Assert(thisAccessor.MethodKind == MethodKind.PropertySet);
Symbols\Source\ThisParameterSymbol.cs (1)
44if (_containingMethod?.MethodKind == MethodKind.Constructor)
Symbols\Symbol.cs (3)
535switch (method.MethodKind) 596switch (method.MethodKind) 1100this is MethodSymbol method && method.MethodKind == MethodKind.FunctionPointerSignature ?
Symbols\Symbol_Attributes.cs (2)
56switch (method.MethodKind) 652Debug.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) 846=> method is { MethodKind: MethodKind.Constructor, HasSetsRequiredMembers: false };
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (1)
120if (member is MethodSymbol { ContainingType.IsRecordStruct: false, MethodKind: MethodKind.Constructor } method)
Symbols\Synthesized\SynthesizedExplicitImplementationForwardingMethod.cs (1)
43_implementingMethod.MethodKind :
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (1)
137return _overriddenAccessor.MethodKind;
Symbols\TypeMap.cs (2)
193stopAt?.MethodKind == MethodKind.StaticConstructor || 194stopAt?.MethodKind == MethodKind.Constructor);
Symbols\TypeSymbol.cs (6)
1559switch (interfaceMethod.MethodKind) 1574throw ExceptionUtilities.UnexpectedValue(interfaceMethod.MethodKind); 1600interfaceMethod.MethodKind, 1684else if (implicitImplMethod.IsStatic && implicitImplMethod.MethodKind == MethodKind.Ordinary && implicitImplMethod.GetUnmanagedCallersOnlyAttributeData(forceComplete: true) is not null) 2131isOperator = interfaceMethod.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion; 2139(((MethodSymbol)member).MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion) != isOperator.GetValueOrDefault())
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
284return UnderlyingMethod.MethodKind;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (18)
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)
161Assert.Equal(MethodKind.ExplicitInterfaceImplementation, getMethod.MethodKind); //since CallMethodsDirectly 166Assert.Equal(MethodKind.ExplicitInterfaceImplementation, setMethod.MethodKind); //since CallMethodsDirectly 269Assert.Equal(MethodKind.PropertyGet, getMethod.MethodKind); 281Assert.Equal(MethodKind.PropertySet, setMethod.MethodKind);
Emit\CompilationEmitTests.cs (1)
2732var cciMethods = class1TypeDef.GetMethods(context).Where(m => ((MethodSymbol)m.GetInternalSymbol()).MethodKind != MethodKind.Constructor);
Emit\EditAndContinue\SymbolMatcherTests.cs (8)
2020var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 2021var members0 = compilation0.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 2071var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 2072var members0 = compilation0.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 2132var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 2133var members0 = compilation0.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 2188var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 2242var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray();
Emit\EmitMetadataTests.cs (2)
602Assert.Equal(MethodKind.Constructor, ctor.MethodKind); 623Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Attributes\AttributeTests_CallerInfoAttributes.cs (2)
4392Assert.Equal(MethodKind.Constructor, ctor.MethodKind); 4422Assert.Equal(MethodKind.Constructor, ctor.MethodKind);
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (2)
CSharpInstructionDecoder.cs (2)
39var displayFormat = (method.MethodKind == MethodKind.PropertyGet || method.MethodKind == MethodKind.PropertySet)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (12)
Semantics\InitOnlyMemberTests.cs (1)
2560bool isSetter = method.MethodKind == MethodKind.PropertySet;
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 (2)
439switch (method.MethodKind) 459return !(nativeIntegerMember is MethodSymbol { MethodKind: MethodKind.Constructor });
Semantics\OperatorTests.cs (1)
8102Assert.Equal(MethodKind.UserDefinedOperator, s.MethodKind);
Semantics\PrimaryConstructorTests.cs (2)
134Assert.Equal(MethodKind.Constructor, members.Cast<MethodSymbol>().Single().MethodKind); 713Assert.All(c.GetMembers(), m => Assert.True(m is MethodSymbol { MethodKind: MethodKind.Constructor }));
Semantics\RecordTests.cs (1)
22537var ordinaryMethods = comp.GetMember<NamedTypeSymbol>("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind == MethodKind.Ordinary).ToArray();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (331)
DocumentationComments\DocumentationCommentIDTests.cs (1)
351var method = type.GetMembersUnordered().OfType<MethodSymbol>().Single(m => m.MethodKind == MethodKind.ExplicitInterfaceImplementation);
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\DefaultInterfaceImplementationTests.cs (5)
43768Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 44485Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 44583Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 45051Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 45519Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind);
Symbols\InterfaceImplementationTests.cs (23)
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); 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)
97switch (accessor.MethodKind) 106Assert.False(true, string.Format("Accessor {0} has unexpected MethodKind {1}", accessor, accessor.MethodKind));
Symbols\Metadata\PE\LoadingIndexers.cs (3)
1062Assert.Equal(MethodKind.Ordinary, accessor.MethodKind); 1067Assert.Equal(propertyIsIndexer ? MethodKind.PropertyGet : MethodKind.Ordinary, accessor.MethodKind); 1074Assert.Equal(propertyIsIndexer ? MethodKind.PropertySet : MethodKind.Ordinary, accessor.MethodKind);
Symbols\Metadata\PE\LoadingMethods.cs (20)
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\RequiredMembersTests.cs (1)
86foreach (var ctor in type.GetMembers().Where(m => m is MethodSymbol { MethodKind: MethodKind.Constructor }))
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (5)
88if (method.MethodKind == MethodKind.ExplicitInterfaceImplementation) 158Assert.Equal(MethodKind.ExplicitInterfaceImplementation, retargetedClassCMethod1.MethodKind); 169Assert.Equal(MethodKind.ExplicitInterfaceImplementation, retargetedClassCMethod2.MethodKind); 178Assert.Equal(MethodKind.ExplicitInterfaceImplementation, retargetedClassCMethod3.MethodKind); 187Assert.Equal(MethodKind.ExplicitInterfaceImplementation, retargetedClassCMethod4.MethodKind);
Symbols\Source\CustomModifierCopyTests.cs (4)
607var explicitGetterImpl = explicitImpls.Where(impl => impl.ImplementingMethod.MethodKind == MethodKind.PropertyGet).Single(); 610var explicitSetterImpl = explicitImpls.Where(impl => impl.ImplementingMethod.MethodKind == MethodKind.PropertySet).Single(); 1343m => m.MethodKind == MethodKind.ExplicitInterfaceImplementation); 1387m => m.MethodKind == MethodKind.ExplicitInterfaceImplementation);
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\PropertyTests.cs (4)
604Assert.True(accessor.MethodKind == MethodKind.PropertyGet || accessor.MethodKind == MethodKind.PropertySet, 605"Accessor kind: " + accessor.MethodKind.ToString()); 765Assert.Equal(accessor.MethodKind, methodKind);
Symbols\Source\RecordTests.cs (2)
153Assert.Equal(MethodKind.PropertyGet, x.GetMethod!.MethodKind); 187Assert.Equal(MethodKind.PropertyGet, y.GetMethod!.MethodKind);
Symbols\StaticAbstractMembersInInterfacesTests.cs (122)
16107Assert.Equal(MethodKind.Ordinary, cM01.MethodKind); 16169Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 16518Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 16530Assert.Equal(MethodKind.Ordinary, c1M01.MethodKind); 16535Assert.Equal(MethodKind.Ordinary, c2M01.MethodKind); 16603Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 16616Assert.Equal(MethodKind.Ordinary, c1M01.MethodKind); 16622Assert.Equal(MethodKind.Ordinary, c1M01.MethodKind); 16637Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 19342Assert.Equal(MethodKind.UserDefinedOperator, cM01.MethodKind); 19423Assert.Equal(MethodKind.UserDefinedOperator, cM01.MethodKind); 19515Assert.Equal(MethodKind.UserDefinedOperator, cM01.MethodKind); 19613Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 19696Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 19788Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 19877Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 20303Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20304Assert.Equal(MethodKind.UserDefinedOperator, c1.GetMember<MethodSymbol>(opName).MethodKind); 20309Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 20325Assert.Equal(MethodKind.UserDefinedOperator, c2M01.MethodKind); 20438Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20439Assert.Equal(MethodKind.UserDefinedOperator, c1.GetMember<MethodSymbol>(opName).MethodKind); 20444Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 20460Assert.Equal(MethodKind.UserDefinedOperator, c2M01.MethodKind); 20517Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20597Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20689Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20754Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20835Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 20850Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 20857Assert.Equal(MethodKind.UserDefinedOperator, c2M01.MethodKind); 20951Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 20964Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 20970Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 20985Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 21062Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 21075Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21081Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21096Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 21197Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 21210Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21216Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21230Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 22981Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 22996Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 23077Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 23089Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 23167Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 23182Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 23700Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 23758Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 23770Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 23862Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 24052Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 24110Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 24122Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 24214Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 24441Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Get.MethodKind); 24447Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Set.MethodKind); 24471Assert.Equal(MethodKind.PropertyGet, c1M01Get.MethodKind); 24482Assert.Equal(MethodKind.PropertySet, c1M01Set.MethodKind); 24496Assert.Equal(MethodKind.PropertyGet, c2M01Get.MethodKind); 24502Assert.Equal(MethodKind.PropertySet, c2M01Set.MethodKind); 24620Assert.Equal(MethodKind.PropertyGet, c1M01Get.MethodKind); 24630Assert.Equal(MethodKind.PropertySet, c1M01Set.MethodKind); 24645Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01Set.MethodKind); 24681Assert.Equal(MethodKind.PropertyGet, c2M01Get.MethodKind); 24692Assert.Equal(MethodKind.PropertySet, c2M01Set.MethodKind); 24721Assert.Equal(MethodKind.PropertyGet, c3M01Get.MethodKind); 24732Assert.Equal(MethodKind.PropertySet, c3M01Set.MethodKind); 25759Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 25774Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 25854Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 25869Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 26402Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 26414Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 26676Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 26688Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 26969Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Add.MethodKind); 26975Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Remove.MethodKind); 26999Assert.Equal(MethodKind.EventAdd, c1M01Add.MethodKind); 27010Assert.Equal(MethodKind.EventRemove, c1M01Remove.MethodKind); 27024Assert.Equal(MethodKind.EventAdd, c2M01Add.MethodKind); 27030Assert.Equal(MethodKind.EventRemove, c2M01Remove.MethodKind); 27160Assert.Equal(MethodKind.EventAdd, c1M01Add.MethodKind); 27171Assert.Equal(MethodKind.EventRemove, c1M01Remove.MethodKind); 27185Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01Add.MethodKind); 27197Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01Remove.MethodKind); 27237Assert.Equal(MethodKind.EventAdd, c2M01Add.MethodKind); 27249Assert.Equal(MethodKind.EventRemove, c2M01Remove.MethodKind); 27271Assert.Equal(MethodKind.EventAdd, c3M02Add.MethodKind); 27282Assert.Equal(MethodKind.EventRemove, c3M02Remove.MethodKind); 27296Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c3M02Add.MethodKind); 27308Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c3M02Remove.MethodKind); 27350Assert.Equal(MethodKind.EventAdd, c4M02Add.MethodKind); 27363Assert.Equal(MethodKind.EventRemove, c4M02Remove.MethodKind); 28699Assert.Equal(MethodKind.Conversion, cM01.MethodKind); 28724Assert.Equal(MethodKind.Conversion, cM02.MethodKind); 28825Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 28841Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM02.MethodKind); 29042Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29043Assert.Equal(MethodKind.Conversion, c1.GetMember<MethodSymbol>(opName).MethodKind); 29048Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 29064Assert.Equal(MethodKind.Conversion, c2M01.MethodKind); 29122Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29218Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29294Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 29309Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 29316Assert.Equal(MethodKind.Conversion, c2M01.MethodKind); 29409Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 29422Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 29428Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 29443Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 32215var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 32217Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 32252var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 32256Assert.Equal(MethodKind.UserDefinedOperator, opSymbol1.MethodKind); 32262Assert.Equal(MethodKind.UserDefinedOperator, opSymbol2.MethodKind); 32463var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 32465Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 32650var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 32652Assert.Equal(MethodKind.Conversion, opSymbol.MethodKind);
Symbols\TypeTests.cs (1)
1204.Count(m => !(m is MethodSymbol) || (m as MethodSymbol).MethodKind != 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.Test.Utilities (4)
Extensions.cs (3)
533switch (accessor.MethodKind) 543var isSetter = accessor.MethodKind == MethodKind.PropertySet; 575Assert.False(true, "Unexpected accessor kind " + accessor.MethodKind);
FunctionPointerUtilities.cs (1)
58Assert.Equal(MethodKind.FunctionPointerSignature, symbol.MethodKind);