24 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)
201public override MethodKind MethodKind
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
772public override MethodKind MethodKind => MethodKind.FunctionPointerSignature;
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1100public override MethodKind MethodKind
Symbols\ReducedExtensionMethodSymbol.cs (1)
469public override MethodKind MethodKind
Symbols\SignatureOnlyMethodSymbol.cs (1)
93public override MethodKind MethodKind { get { return _methodKind; } }
Symbols\Source\LambdaSymbol.cs (1)
76public override MethodKind MethodKind
Symbols\Source\LocalFunctionSymbol.cs (1)
332public override MethodKind MethodKind => MethodKind.LocalFunction;
Symbols\Source\SourceMemberMethodSymbol.cs (1)
554public 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)
246public 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)
67public 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
675 references to MethodKind
Microsoft.CodeAnalysis.CSharp (228)
Binder\Binder.cs (1)
754return symbol.GetIsNewExtensionMember() && (symbol.IsStatic || symbol.MethodKind != MethodKind.Ordinary);
Binder\Binder.ValueChecks.cs (3)
1462canModifyReadonly = (containingMethod.MethodKind == desiredMethodKind) || 1923if (method.MethodKind == MethodKind.Constructor || method.IsInitOnly) 2602if (method.MethodKind == MethodKind.Constructor)
Binder\Binder_Await.cs (1)
175if (method.MethodKind == MethodKind.AnonymousFunction)
Binder\Binder_Conversions.cs (2)
2674Debug.Assert(memberSymbol is not MethodSymbol { MethodKind: not MethodKind.Constructor } || 2679if (receiverOpt != null || memberSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor })
Binder\Binder_Crefs.cs (1)
959MethodKind candidateMethodKind = candidateMethod.MethodKind;
Binder\Binder_Expressions.cs (9)
1513ContainingMember() is MethodSymbol { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: PropertySymbol { IsIndexer: false } }) 1983return (containingMethod.MethodKind == MethodKind.AnonymousFunction || containingMethod.MethodKind == MethodKind.LocalFunction) && !IsInsideNameof; // false in EE evaluation method 2121(this.ContainingMember() is MethodSymbol { MethodKind: MethodKind.Constructor } containingMember && (object)containingMember != primaryCtor)) && // We are in a non-primary instance constructor 2184this.ContainingMemberOrLambda is MethodSymbol { MethodKind: MethodKind.AnonymousFunction or MethodKind.LocalFunction } && 4825Debug.Assert(constructor.MethodKind == MethodKind.Constructor || 4826constructor.MethodKind == MethodKind.StaticConstructor); // error scenario: constructor initializer on static constructor 6634Debug.Assert(constructor.MethodKind == MethodKind.Constructor || constructor.MethodKind == MethodKind.StaticConstructor);
Binder\Binder_Invocation.cs (2)
816if (result is null && finalApplicableCandidates[0].LeastOverriddenMember.MethodKind != MethodKind.LocalFunction) 905if (singleCandidate.MethodKind != MethodKind.LocalFunction)
Binder\Binder_Lookup.cs (1)
1490else if ((options & LookupOptions.MustBeOperator) != 0 && unwrappedSymbol is not MethodSymbol { MethodKind: MethodKind.UserDefinedOperator })
Binder\Binder_Statements.cs (2)
1809return (member as MethodSymbol)?.MethodKind == (isStatic ? 3823if (constructor.MethodKind != MethodKind.Constructor || constructor.IsExtern)
Binder\InMethodBinder.cs (3)
88internal override bool IsNestedFunctionBinder => _methodSymbol.MethodKind == MethodKind.LocalFunction; 273if (((MethodSymbol)newSymbol).MethodKind == MethodKind.LocalFunction) 309if (((MethodSymbol)newSymbol).MethodKind == MethodKind.LocalFunction)
Binder\LockBinder.cs (1)
122MethodKind: MethodKind.Ordinary,
Binder\MethodGroupResolution.cs (1)
104MethodGroup.Methods[0].MethodKind == MethodKind.LocalFunction;
Binder\Semantics\AccessCheck.cs (1)
196case SymbolKind.Method when ((MethodSymbol)symbol).MethodKind == MethodKind.LocalFunction:
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
4575Debug.Assert(candidate is MethodSymbol { MethodKind: MethodKind.UserDefinedOperator });
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\CodeGenerator_HasHome.cs (2)
252return containingSymbol is MethodSymbol { MethodKind: MethodKind.StaticConstructor } or FieldSymbol { IsStatic: true }; 256return (containingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor } or FieldSymbol { IsStatic: false } or MethodSymbol { IsInitOnly: true }) &&
CodeGen\EmitExpression.cs (1)
2186if (method.IsEffectivelyReadOnly && method.MethodKind != MethodKind.Constructor)
Compilation\CSharpCompilation.cs (1)
3102if (symbol.Kind == SymbolKind.Method && symbol.IsImplicitlyDeclared && ((MethodSymbol)symbol).MethodKind == MethodKind.Constructor)
Compilation\CSharpSemanticModel.cs (2)
1795case MethodSymbol { MethodKind: MethodKind.LambdaMethod }: 4793if (call.InvokedAsExtensionMethod && method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension)
Compilation\MemberSemanticModel.cs (1)
2343Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod });
Compilation\MethodBodySemanticModel.cs (1)
241if (MemberSymbol is MethodSymbol methodSymbol && methodSymbol.MethodKind == MethodKind.Constructor &&
Compilation\SyntaxTreeSemanticModel.cs (1)
2442Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod });
Compiler\ClsComplianceChecker.cs (1)
736if (method.MethodKind == MethodKind.DelegateInvoke)
Compiler\MethodBodySynthesizer.cs (1)
532Debug.Assert(method.MethodKind == MethodKind.Destructor);
Compiler\MethodCompiler.cs (7)
540(method.MethodKind == MethodKind.Constructor || method.IsScriptInitializer) ? processedInstanceInitializers : 541method.MethodKind == MethodKind.StaticConstructor ? processedStaticInitializers : 1105if ((methodSymbol.MethodKind == MethodKind.Constructor || methodSymbol.MethodKind == MethodKind.StaticConstructor) && 1870if (method.MethodKind == MethodKind.StaticConstructor && 2046if (method.MethodKind == MethodKind.Destructor && body != null) 2448if (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)
359else if (method.MethodKind == MethodKind.Destructor && AdaptedNamedTypeSymbol.SpecialType != SpecialType.System_Object) 370if ((object)objectMethod != null && objectMethod.MethodKind == MethodKind.Destructor) 632if ((alwaysIncludeConstructors && method.MethodKind == MethodKind.Constructor) || method is SynthesizedExtensionMarker || method.GetCciAdapter().ShouldInclude(context))
Emitter\NoPia\EmbeddedMethod.cs (1)
70return UnderlyingMethod.AdaptedMethodSymbol.MethodKind == MethodKind.Constructor;
FlowAnalysis\AbstractFlowPass.cs (2)
1420if (method is null || method.MethodKind != MethodKind.Constructor) 1517Debug.Assert(method?.OriginalDefinition.MethodKind != MethodKind.LocalFunction);
FlowAnalysis\DefiniteAssignment.cs (6)
103&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1259Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1312if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 2384(currentMethod.MethodKind == MethodKind.AnonymousFunction || 2385currentMethod.MethodKind == MethodKind.LocalFunction) && 2427if (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 (5)
474Debug.Assert(baseOrThisInitializer is null or { MethodKind: MethodKind.Constructor }); 1549return constructorBody is BoundConstructorMethodBody { Initializer: BoundExpressionStatement { Expression: BoundCall { Method: { MethodKind: MethodKind.Constructor } initializerMethod } } } 2230while (enclosingMemberMethod?.MethodKind is MethodKind.AnonymousFunction or MethodKind.LocalFunction) 6728|| method.MethodKind != MethodKind.Ordinary 8674if (((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 (10)
194_seenBaseCall = method.MethodKind != MethodKind.Constructor; // only used for ctors 208(localOrParameter as MethodSymbol)?.MethodKind == MethodKind.LocalFunction); 440originalMethod.MethodKind == MethodKind.LambdaMethod && 794if (_currentMethod.MethodKind == MethodKind.Constructor && 863var loweredSymbol = (node.Method.MethodKind is MethodKind.LambdaMethod or MethodKind.LocalFunction) ? 881Debug.Assert(localFunc.MethodKind == MethodKind.LocalFunction); 1076if (node.Method.MethodKind == MethodKind.LocalFunction) 1341if (node.MethodOpt?.MethodKind == MethodKind.LocalFunction) 1367if (node.TargetMethod.MethodKind == MethodKind.LocalFunction) 1676_currentMethod.MethodKind != MethodKind.StaticConstructor &&
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (2)
39originalMethod is { MethodKind: MethodKind.LocalFunction } 106Debug.Assert(originalMethod is not { MethodKind: MethodKind.LocalFunction } || !originalMethod.IsStatic || IsStatic);
Lowering\DiagnosticsPass_ExpressionTrees.cs (4)
197var diagnostic = _staticLocalOrAnonymousFunction.MethodKind == MethodKind.LocalFunction 212var diagnostic = _staticLocalOrAnonymousFunction.MethodKind == MethodKind.LocalFunction 352else if (method.MethodKind == MethodKind.LocalFunction) 940if ((node.LookupSymbolOpt as MethodSymbol)?.MethodKind == MethodKind.LocalFunction)
Lowering\DiagnosticsPass_Warnings.cs (1)
368if ((object)op == null || op.MethodKind != MethodKind.UserDefinedOperator) continue;
Lowering\ExtensionMethodBodyRewriter.cs (1)
150switch (symbol?.MethodKind)
Lowering\ExtensionMethodReferenceRewriter.cs (2)
77Debug.Assert(node.Method.MethodKind == MethodKind.LocalFunction || node.Method.IsStatic || node.ReceiverOpt is not null); 173method.MethodKind is (MethodKind.Constructor or MethodKind.StaticConstructor) ||
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)) 188methodDefinition.MethodKind == overload.MethodKind &&
Lowering\Instrumentation\StackOverflowProbingInstrumenter.cs (2)
40if (method.MethodKind is not (MethodKind.Constructor or MethodKind.StaticConstructor) && 74if (isMethodBody && _factory.TopLevelMethod.MethodKind == MethodKind.StaticConstructor)
Lowering\LocalRewriter\DelegateCacheRewriter.cs (2)
128if (targetMethod.MethodKind == MethodKind.LocalFunction) 167Debug.Assert(targetMethod.MethodKind == MethodKind.Ordinary);
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (3)
155node.Method.MethodKind == MethodKind.LocalFunction || 216if (conversion.Method.MethodKind == MethodKind.LocalFunction) 240node.MethodOpt?.MethodKind == MethodKind.LocalFunction;
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
193if (method.MethodKind is not MethodKind.Ordinary) 682var requiresInstanceReceiver = methodOrIndexer.RequiresInstanceReceiver() && methodOrIndexer is not MethodSymbol { MethodKind: MethodKind.Constructor } and not FunctionPointerMethodSymbol;
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
921if (asSpanMethod is MethodSymbol { MethodKind: MethodKind.Constructor } constructor)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
580&& _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)
72value.MethodKind != MethodKind.AnonymousFunction && 73value.MethodKind != MethodKind.LocalFunction) 141CurrentFunction.MethodKind == MethodKind.AnonymousFunction || 142CurrentFunction.MethodKind == MethodKind.LocalFunction ||
Symbols\Compilation_WellKnownMembers.cs (1)
308MethodKind methodKind = method.MethodKind;
Symbols\Extensions\SourceExtensionImplementationMethodSymbol.cs (1)
48public sealed override bool IsExtensionMethod => !_originalMethod.IsStatic && _originalMethod.MethodKind is MethodKind.Ordinary;
Symbols\MemberSymbolExtensions.cs (6)
407return methodSymbol.MethodKind == MethodKind.UserDefinedOperator || methodSymbol.MethodKind == MethodKind.Conversion; 427return symbol.Kind == SymbolKind.Method && ((MethodSymbol)symbol).MethodKind == MethodKind.Conversion; 594switch (method.MethodKind) 609if ((object)method != null && method.MethodKind == MethodKind.Constructor) 674return method.MethodKind == MethodKind.Constructor && method.ParameterCount == 0;
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1368method.MethodKind == MethodKind.Destructor);
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
885case "" when !ContainingSymbol.RequiresInstanceReceiver() || ContainingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.DelegateInvoke }:
Symbols\MethodSymbol.cs (10)
371protected bool IsValidReadOnlyTarget => !IsStatic && ContainingType.IsStructType() && MethodKind != MethodKind.Constructor && !IsInitOnly; 591internal bool HasSetsRequiredMembers => MethodKind == MethodKind.Constructor && HasSetsRequiredMembersImpl; 657return MethodKind == MethodKind.Constructor && ContainingType.IsScriptClass; 673return ((MethodKind == MethodKind.Constructor || MethodKind == MethodKind.StaticConstructor) && IsImplicitlyDeclared); 684return MethodKind == MethodKind.Constructor && IsImplicitlyDeclared; 761if (!this.IsExtensionMethod || this.MethodKind == MethodKind.ReducedExtension || receiverType.IsVoidType()) 776return (this.IsExtensionMethod && this.MethodKind != MethodKind.ReducedExtension) ? ReducedExtensionMethodSymbol.Create(this) : null; 1044if (!IsStatic || IsAbstract || IsVirtual || MethodKind is not (MethodKind.Ordinary or MethodKind.LocalFunction)) 1204MethodKind is MethodKind.Ordinary
Symbols\MethodSymbolExtensions.cs (6)
24return method.IsImplicitlyDeclared && method.MethodKind == MethodKind.AnonymousFunction; 53if (!skipFirstMethodKindCheck && method.MethodKind == MethodKind.Destructor) 100if (hiddenMethod.MethodKind == MethodKind.Destructor) 126switch (method.MethodKind) 135return !method.IsStatic && hidingMember is MethodSymbol { IsStatic: false, MethodKind: MethodKind.UserDefinedOperator }; 223method.MethodKind is (MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.PropertyGet or MethodKind.PropertySet or MethodKind.UserDefinedOperator) &&
Symbols\NamedTypeSymbol.cs (4)
221if (candidate is MethodSymbol { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } method) 282Debug.Assert(method.MethodKind == MethodKind.Constructor); 290Debug.Assert(method.MethodKind == MethodKind.StaticConstructor); 370Debug.Assert(method.MethodKind != MethodKind.ReducedExtension);
Symbols\NativeIntegerTypeSymbol.cs (1)
95switch (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)
37switch (_underlying.MethodKind) 74throw ExceptionUtilities.UnexpectedValue(_underlying.MethodKind);
Symbols\ReducedExtensionMethodSymbol.cs (3)
39Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 74Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 116Debug.Assert(method.MethodKind != MethodKind.ReducedExtension);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
1018method.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)
227Debug.Assert(methodOwner?.MethodKind != MethodKind.LambdaMethod); 229methodOwner?.MethodKind == MethodKind.LocalFunction; 1107if (method.MethodKind != MethodKind.AnonymousFunction)
Symbols\Source\SourceComplexParameterSymbol.cs (1)
1342if (!ContainingSymbol.RequiresInstanceReceiver() || ContainingSymbol is MethodSymbol { MethodKind: MethodKind.Constructor or MethodKind.DelegateInvoke or MethodKind.LambdaMethod })
Symbols\Source\SourceMemberContainerSymbol.cs (17)
2094if (symbol is MethodSymbol { MethodKind: MethodKind.Conversion } conversion) 2203var methodKind = method1.MethodKind == MethodKind.Constructor ? MessageID.IDS_SK_CONSTRUCTOR : MessageID.IDS_SK_METHOD; 2216var methodName = (method1.MethodKind == MethodKind.Destructor && method2.MethodKind == MethodKind.Destructor) ? 2715if (member.Kind != SymbolKind.Method || ((MethodSymbol)member).MethodKind != MethodKind.Destructor) 3871if (member is MethodSymbol { IsImplicitlyDeclared: false, MethodKind: not (MethodKind.Constructor or MethodKind.StaticConstructor or MethodKind.Destructor or MethodKind.ExplicitInterfaceImplementation) } method && 4410if ((methodSymbol.MethodKind == MethodKind.Ordinary) && 4449if ((methodSymbol.MethodKind == MethodKind.Ordinary) && 4602switch (meth.MethodKind) 4625throw ExceptionUtilities.UnexpectedValue(meth.MethodKind); 4664switch (meth.MethodKind) 4680throw ExceptionUtilities.UnexpectedValue(meth.MethodKind); 4713if (m.MethodKind == MethodKind.Constructor && m.ParameterCount == 0) 4755if (hasInitializers && !builder.NonTypeMembersWithPartialImplementations.Any(member => member is MethodSymbol { MethodKind: MethodKind.Constructor })) 4807case MethodSymbol { MethodKind: not (MethodKind.Ordinary or MethodKind.Constructor) }: 5420switch (method.MethodKind) 6032if (member is MethodSymbol { MethodKind: MethodKind.Ordinary })
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (3)
537if (MethodSymbol.CanOverrideOrHide(method.MethodKind) && !method.IsAccessor()) 553else if (method.MethodKind == MethodKind.Destructor) 892!(overridingMemberIsMethod && ((MethodSymbol)overriddenMember).MethodKind == MethodKind.Destructor)) //destructors are metadata virtual
Symbols\Source\SourceMethodSymbol.cs (1)
238if (target.MethodKind == MethodKind.UserDefinedOperator && !target.IsStatic)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (11)
153switch (MethodKind) 733else if (!this.CanBeReferencedByName || this.MethodKind == MethodKind.Destructor) 748else if (this is { MethodKind: MethodKind.LocalFunction, IsStatic: false }) 946if (MethodKind != MethodKind.Ordinary || this.GetIsNewExtensionMember()) 1356if (MethodKind != MethodKind.Ordinary) 1473switch (this.MethodKind) 1503var errorCode = (this.MethodKind == MethodKind.Constructor || this.MethodKind == MethodKind.StaticConstructor) ? 1555if (this.MethodKind != MethodKind.LambdaMethod) 1657switch (this.MethodKind) 1741if (this.ContainingType.IsComImport && this.MethodKind == MethodKind.Constructor)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1850&& !GetMembers().All(m => m is not MethodSymbol { MethodKind: MethodKind.Constructor, ObsoleteKind: ObsoleteAttributeKind.None } method
Symbols\Source\SourcePropertySymbolBase.cs (1)
1206Debug.Assert(thisAccessor.MethodKind == MethodKind.PropertySet);
Symbols\Source\ThisParameterSymbol.cs (1)
157if (_containingMethod?.MethodKind == MethodKind.Constructor)
Symbols\Symbol.cs (3)
668switch (method.MethodKind) 729switch (method.MethodKind) 1250this is MethodSymbol method && method.MethodKind == MethodKind.FunctionPointerSignature ?
Symbols\Symbol_Attributes.cs (2)
56switch (method.MethodKind) 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) 815=> method is { MethodKind: MethodKind.Constructor, HasSetsRequiredMembers: false };
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (1)
135if (member is MethodSymbol { ContainingType.IsRecord: true, MethodKind: MethodKind.Constructor } method)
Symbols\Synthesized\SynthesizedExplicitImplementationForwardingMethod.cs (1)
43_implementingMethod.MethodKind :
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (1)
137return _overriddenAccessor.MethodKind;
Symbols\TypeMap.cs (2)
187stopAt?.MethodKind == MethodKind.StaticConstructor || 188stopAt?.MethodKind == MethodKind.Constructor);
Symbols\TypeSymbol.cs (6)
1579switch (interfaceMethod.MethodKind) 1594throw ExceptionUtilities.UnexpectedValue(interfaceMethod.MethodKind); 1620interfaceMethod.MethodKind, 1714else if (implicitImplMethod.IsStatic && implicitImplMethod.MethodKind == MethodKind.Ordinary && implicitImplMethod.GetUnmanagedCallersOnlyAttributeData(forceComplete: true) is not null) 2196isOperator = interfaceMethod.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion; 2204(((MethodSymbol)member).MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion) != isOperator.GetValueOrDefault())
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
284return UnderlyingMethod.MethodKind;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (10)
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)
2733var cciMethods = class1TypeDef.GetMethods(context).Where(m => ((MethodSymbol)m.GetInternalSymbol()).MethodKind != MethodKind.Constructor);
Emit\EmitMetadataTests.cs (2)
603Assert.Equal(MethodKind.Constructor, ctor.MethodKind); 624Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (8)
Emit\EditAndContinue\SymbolMatcherTests.cs (8)
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 (84)
Attributes\AttributeTests_CallerInfoAttributes.cs (2)
4405Assert.Equal(MethodKind.Constructor, ctor.MethodKind); 4435Assert.Equal(MethodKind.Constructor, ctor.MethodKind);
Semantics\ExtensionOperatorsTests.cs (9)
450Assert.Equal(MethodKind.Ordinary, method.MethodKind); 489Assert.Equal(MethodKind.Ordinary, method.MethodKind); 530Assert.Equal(MethodKind.Ordinary, method.MethodKind); 4540Assert.Equal(MethodKind.Ordinary, method.MethodKind); 4576Assert.Equal(MethodKind.Ordinary, method.MethodKind); 4587Assert.Equal(MethodKind.Ordinary, method.MethodKind); 11191Assert.Equal(MethodKind.Ordinary, method.MethodKind); 11263Assert.Equal(MethodKind.Ordinary, method.MethodKind); 20049Assert.Equal(MethodKind.Ordinary, method.MethodKind);
Semantics\ExtensionTests.cs (5)
4986Assert.Equal(MethodKind.Ordinary, implementation.MethodKind); 6441Assert.Equal(MethodKind.Ordinary, implementation.MethodKind); 7916Assert.Equal(MethodKind.Ordinary, implementation.MethodKind); 9422Assert.Equal(MethodKind.Ordinary, implementation.MethodKind); 9711Assert.Equal(MethodKind.Ordinary, implementation.MethodKind);
Semantics\ParamsCollectionTests.cs (1)
8885bool hasBody = p.ContainingSymbol is not MethodSymbol { MethodKind: MethodKind.DelegateInvoke };
Semantics\PrimaryConstructorTests.cs (2)
135Assert.Equal(MethodKind.Constructor, members.Cast<MethodSymbol>().Single().MethodKind); 822Assert.All(c.GetMembers(), m => Assert.True(m is MethodSymbol { MethodKind: MethodKind.Constructor }));
Semantics\RecordTests.cs (1)
22631var ordinaryMethods = comp.GetMember<NamedTypeSymbol>("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind == MethodKind.Ordinary).ToArray();
Symbols\UserDefinedCompoundAssignmentOperatorsTests.cs (64)
74Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 402Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 460Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 516Assert.Equal(MethodKind.ExplicitInterfaceImplementation, m.MethodKind); 583Assert.Equal(MethodKind.ExplicitInterfaceImplementation, m.MethodKind); 636Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 695Assert.Equal(MethodKind.ExplicitInterfaceImplementation, m.MethodKind); 925Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 959Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 1015Assert.Equal(MethodKind.ExplicitInterfaceImplementation, m.MethodKind); 1069Assert.Equal(MethodKind.ExplicitInterfaceImplementation, m.MethodKind); 1122Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 1424Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 1482Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 1532Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 1740Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 1801Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 2334Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 2388Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 2442Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 2528Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 2568Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 2609Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 2650Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 7435Assert.Equal(kind, m.MethodKind); 8034Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 8112Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 8177Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 8288Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 8452Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 8538Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 8611Assert.Equal(MethodKind.ExplicitInterfaceImplementation, m.MethodKind); 8697Assert.Equal(MethodKind.ExplicitInterfaceImplementation, m.MethodKind); 8760Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 8829Assert.Equal(MethodKind.ExplicitInterfaceImplementation, m.MethodKind); 9105Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 9151Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 9224Assert.Equal(MethodKind.ExplicitInterfaceImplementation, m.MethodKind); 9288Assert.Equal(MethodKind.ExplicitInterfaceImplementation, m.MethodKind); 9351Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 9637Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 9686Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 9744Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 9803Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 9850Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 9886Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 10079Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 10128Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 10185Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 10242Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 10821Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 10868Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 10922Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 10969Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 11023Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 11070Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 11192Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 11227Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 11267Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 11303Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 11344Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 11380Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 11421Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind); 11457Assert.Equal(MethodKind.UserDefinedOperator, m.MethodKind);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (9)
Semantics\InitOnlyMemberTests.cs (1)
2565bool 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)
444switch (method.MethodKind) 464return !(nativeIntegerMember is MethodSymbol { MethodKind: MethodKind.Constructor });
Semantics\OperatorTests.cs (1)
8104Assert.Equal(MethodKind.UserDefinedOperator, s.MethodKind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (332)
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); 375var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 406var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 482var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 509var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 540var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 558expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 566expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 712var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 730expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 738expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 835var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 843expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 851expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 884var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 892expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 900expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 929var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 931Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 963var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 967Assert.Equal(MethodKind.UserDefinedOperator, opSymbol1.MethodKind); 973Assert.Equal(MethodKind.UserDefinedOperator, opSymbol2.MethodKind); 1006var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1009Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 1010Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 1042var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1045Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 1048Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 1051Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[2].MethodKind); 1293var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1295Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 1327var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1330Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 1331Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 1362var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1364Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 1365Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 1396var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 1399Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 1400Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 1551var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1578var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1660var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1687var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1720var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1739expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1747expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 1843var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1861expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1876expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1909var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1917expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1925expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1953var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1971expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 1979expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2078var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2096expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2104expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2137var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2145expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2153expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2206var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2208Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 2251var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2254Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[0].MethodKind); 2255Assert.Equal(MethodKind.UserDefinedOperator, opSymbols[1].MethodKind); 2466var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2493var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2527var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2529Assert.Equal(MethodKind.Conversion, opSymbol.MethodKind); 2563var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2566Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 2567Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind); 2603var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2605Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 2606Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind); 2642var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 2645Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 2646Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind); 2783var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2806var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 2879var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2897expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2905expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 3045var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3063expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3071expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3213var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 3215Assert.Equal(MethodKind.Conversion, opSymbol.MethodKind); 3245var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 3248Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 3249Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind);
Symbols\DefaultInterfaceImplementationTests.cs (5)
43953Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 44676Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 44774Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 45242Assert.Equal(MethodKind.StaticConstructor, cctor.MethodKind); 45710Assert.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)
96switch (accessor.MethodKind) 105Assert.False(true, string.Format("Accessor {0} has unexpected MethodKind {1}", accessor, accessor.MethodKind));
Symbols\Metadata\PE\LoadingIndexers.cs (3)
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 (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)
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 (4)
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\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)
121Assert.Equal(MethodKind.Constructor, m.MethodKind); 145Assert.Equal(MethodKind.Ordinary, m.MethodKind); 1677Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 1721Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 1767Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 1821Assert.Equal(MethodKind.ExplicitInterfaceImplementation, classMethod.MethodKind); 1905Assert.Equal(MethodKind.StaticConstructor, staticConstructor.MethodKind); 1929Assert.Equal(MethodKind.StaticConstructor, staticConstructor.MethodKind);
Symbols\Source\PropertyTests.cs (4)
605Assert.True(accessor.MethodKind == MethodKind.PropertyGet || accessor.MethodKind == MethodKind.PropertySet, 606"Accessor kind: " + accessor.MethodKind.ToString()); 766Assert.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)
16065Assert.Equal(MethodKind.Ordinary, cM01.MethodKind); 16127Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 16476Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 16488Assert.Equal(MethodKind.Ordinary, c1M01.MethodKind); 16493Assert.Equal(MethodKind.Ordinary, c2M01.MethodKind); 16561Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 16574Assert.Equal(MethodKind.Ordinary, c1M01.MethodKind); 16580Assert.Equal(MethodKind.Ordinary, c1M01.MethodKind); 16595Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 19856Assert.Equal(MethodKind.UserDefinedOperator, cM01.MethodKind); 19937Assert.Equal(MethodKind.UserDefinedOperator, cM01.MethodKind); 20029Assert.Equal(MethodKind.UserDefinedOperator, cM01.MethodKind); 20127Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 20210Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 20302Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 20391Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 20817Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20818Assert.Equal(MethodKind.UserDefinedOperator, c1.GetMember<MethodSymbol>(opName).MethodKind); 20823Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 20839Assert.Equal(MethodKind.UserDefinedOperator, c2M01.MethodKind); 20952Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 20953Assert.Equal(MethodKind.UserDefinedOperator, c1.GetMember<MethodSymbol>(opName).MethodKind); 20958Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 20974Assert.Equal(MethodKind.UserDefinedOperator, c2M01.MethodKind); 21031Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 21111Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 21203Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 21268Assert.Equal(MethodKind.UserDefinedOperator, m01.MethodKind); 21349Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 21364Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21371Assert.Equal(MethodKind.UserDefinedOperator, c2M01.MethodKind); 21465Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 21478Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21484Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21499Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 21576Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 21589Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21595Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21610Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 21711Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 21724Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21730Assert.Equal(MethodKind.UserDefinedOperator, c1M01.MethodKind); 21744Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 23495Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 23510Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 23591Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 23603Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 23681Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 23696Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 24214Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 24272Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 24284Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 24376Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 24566Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 24624Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 24636Assert.Equal(MethodKind.PropertyGet, cM01Get.MethodKind); 24728Assert.Equal(MethodKind.PropertySet, cM01Set.MethodKind); 24955Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Get.MethodKind); 24961Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Set.MethodKind); 24985Assert.Equal(MethodKind.PropertyGet, c1M01Get.MethodKind); 24996Assert.Equal(MethodKind.PropertySet, c1M01Set.MethodKind); 25010Assert.Equal(MethodKind.PropertyGet, c2M01Get.MethodKind); 25016Assert.Equal(MethodKind.PropertySet, c2M01Set.MethodKind); 25134Assert.Equal(MethodKind.PropertyGet, c1M01Get.MethodKind); 25144Assert.Equal(MethodKind.PropertySet, c1M01Set.MethodKind); 25159Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01Set.MethodKind); 25195Assert.Equal(MethodKind.PropertyGet, c2M01Get.MethodKind); 25206Assert.Equal(MethodKind.PropertySet, c2M01Set.MethodKind); 25235Assert.Equal(MethodKind.PropertyGet, c3M01Get.MethodKind); 25246Assert.Equal(MethodKind.PropertySet, c3M01Set.MethodKind); 26273Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 26288Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 26368Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 26383Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 26916Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 26928Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 27190Assert.Equal(MethodKind.EventRemove, cM01Remove.MethodKind); 27202Assert.Equal(MethodKind.EventAdd, cM01Add.MethodKind); 27483Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Add.MethodKind); 27489Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01Remove.MethodKind); 27513Assert.Equal(MethodKind.EventAdd, c1M01Add.MethodKind); 27524Assert.Equal(MethodKind.EventRemove, c1M01Remove.MethodKind); 27538Assert.Equal(MethodKind.EventAdd, c2M01Add.MethodKind); 27544Assert.Equal(MethodKind.EventRemove, c2M01Remove.MethodKind); 27674Assert.Equal(MethodKind.EventAdd, c1M01Add.MethodKind); 27685Assert.Equal(MethodKind.EventRemove, c1M01Remove.MethodKind); 27699Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01Add.MethodKind); 27711Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01Remove.MethodKind); 27751Assert.Equal(MethodKind.EventAdd, c2M01Add.MethodKind); 27763Assert.Equal(MethodKind.EventRemove, c2M01Remove.MethodKind); 27785Assert.Equal(MethodKind.EventAdd, c3M02Add.MethodKind); 27796Assert.Equal(MethodKind.EventRemove, c3M02Remove.MethodKind); 27810Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c3M02Add.MethodKind); 27822Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c3M02Remove.MethodKind); 27864Assert.Equal(MethodKind.EventAdd, c4M02Add.MethodKind); 27877Assert.Equal(MethodKind.EventRemove, c4M02Remove.MethodKind); 29213Assert.Equal(MethodKind.Conversion, cM01.MethodKind); 29238Assert.Equal(MethodKind.Conversion, cM02.MethodKind); 29339Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM01.MethodKind); 29355Assert.Equal(MethodKind.ExplicitInterfaceImplementation, cM02.MethodKind); 29556Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29557Assert.Equal(MethodKind.Conversion, c1.GetMember<MethodSymbol>(opName).MethodKind); 29562Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 29578Assert.Equal(MethodKind.Conversion, c2M01.MethodKind); 29636Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29732Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29808Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 29823Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 29830Assert.Equal(MethodKind.Conversion, c2M01.MethodKind); 29923Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c1M01.MethodKind); 29936Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 29942Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 29957Assert.Equal(MethodKind.ExplicitInterfaceImplementation, c2M01.MethodKind); 32729var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 32731Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 32766var opSymbols = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).ToArray(); 32770Assert.Equal(MethodKind.UserDefinedOperator, opSymbol1.MethodKind); 32776Assert.Equal(MethodKind.UserDefinedOperator, opSymbol2.MethodKind); 32977var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 32979Assert.Equal(MethodKind.UserDefinedOperator, opSymbol.MethodKind); 33164var opSymbol = c.GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).Single(); 33166Assert.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(); 2875var expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2893expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First(); 2901expectedSymbol = compilation.SourceModule.GlobalNamespace.GetTypeMember("C").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind != MethodKind.Constructor).First();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
Extensions.cs (3)
573switch (accessor.MethodKind) 583var isSetter = accessor.MethodKind == MethodKind.PropertySet; 615Assert.False(true, "Unexpected accessor kind " + accessor.MethodKind);
FunctionPointerUtilities.cs (1)
58Assert.Equal(MethodKind.FunctionPointerSignature, symbol.MethodKind);