Symbols\Metadata\PE\PEMethodSymbol.cs (38)
114public MethodKind MethodKind
118return (MethodKind)((_bits >> MethodKindOffset) & MethodKindMask);
157Debug.Assert(EnumUtilities.ContainsAllValues<MethodKind>(MethodKindMask));
181public void InitializeMethodKind(MethodKind methodKind)
630private bool IsDestructor => this.MethodKind == MethodKind.Destructor;
784internal bool SetAssociatedProperty(PEPropertySymbol propertySymbol, MethodKind methodKind)
786Debug.Assert((methodKind == MethodKind.PropertyGet) || (methodKind == MethodKind.PropertySet));
794internal bool SetAssociatedEvent(PEEventSymbol eventSymbol, MethodKind methodKind)
796Debug.Assert((methodKind == MethodKind.EventAdd) || (methodKind == MethodKind.EventRemove));
800private bool SetAssociatedPropertyOrEvent(Symbol propertyOrEventSymbol, MethodKind methodKind)
813_packedFlags.MethodKind == default(MethodKind) ||
814_packedFlags.MethodKind == MethodKind.Ordinary ||
815_packedFlags.MethodKind == MethodKind.ExplicitInterfaceImplementation);
975if (this.MethodKind == MethodKind.Ordinary && IsValidExtensionMethodSignature()
1003: this.MethodKind == MethodKind.Ordinary
1099public override MethodKind MethodKind
1168private MethodKind ComputeMethodKind()
1192return MethodKind.StaticConstructor;
1197return MethodKind.Constructor;
1201return MethodKind.Ordinary;
1229return IsValidUserDefinedOperatorSignature(2) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary;
1241return IsValidUserDefinedOperatorSignature(1) ? MethodKind.UserDefinedOperator : MethodKind.Ordinary;
1245return IsValidUserDefinedOperatorSignature(1) ? MethodKind.Conversion : MethodKind.Ordinary;
1255return MethodKind.Ordinary;
1267return MethodKind.Destructor;
1273return MethodKind.DelegateInvoke;
1284return MethodKind.ExplicitInterfaceImplementation;
1287return MethodKind.Ordinary;
1321method.MethodKind == MethodKind.Destructor);
1413this.MethodKind == MethodKind.PropertySet &&
1468var diag = PEUtilities.DeriveCompilerFeatureRequiredAttributeDiagnostic(this, containingModule, Handle, allowedFeatures: MethodKind == MethodKind.Constructor ? CompilerFeatureRequiredFeatures.RequiredMembers : CompilerFeatureRequiredFeatures.None, decoder);
1556Debug.Assert(MethodKind == MethodKind.Constructor);
1578var result = ObsoleteAttributeHelpers.GetObsoleteDataFromMetadata(_handle, (PEModuleSymbol)ContainingModule, ignoreByRefLikeMarker: false, ignoreRequiredMemberMarker: MethodKind == MethodKind.Constructor);
Symbols\Source\SourceConstructorSymbol.cs (12)
21var methodKind = syntax.Modifiers.Any(SyntaxKind.StaticKeyword) ? MethodKind.StaticConstructor : MethodKind.Constructor;
29MethodKind methodKind,
53if (methodKind == MethodKind.Constructor && syntax.Initializer != null)
64if (methodKind == MethodKind.StaticConstructor)
83MethodKind methodKind,
123NamedTypeSymbol containingType, ConstructorDeclarationSyntax syntax, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics,
126var defaultAccess = (methodKind == MethodKind.StaticConstructor) ? DeclarationModifiers.None : DeclarationModifiers.Private;
139if (methodKind == MethodKind.StaticConstructor)
165private void CheckModifiers(MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics)
175else if (ContainingType.IsStatic && methodKind == MethodKind.Constructor)
Symbols\Source\SourceDelegateMethodSymbol.cs (5)
26MethodKind methodKind,
217: base(delegateType, voidType, syntax, MethodKind.Constructor, RefKind.None, DeclarationModifiers.Public)
262: base(delegateType, returnType, syntax, MethodKind.DelegateInvoke, refKind, DeclarationModifiers.Virtual | DeclarationModifiers.Public)
355: base((SourceNamedTypeSymbol)invoke.ContainingType, iAsyncResultType, syntax, MethodKind.Ordinary, RefKind.None, DeclarationModifiers.Virtual | DeclarationModifiers.Public)
393: base((SourceNamedTypeSymbol)invoke.ContainingType, invoke.ReturnTypeWithAnnotations, syntax, MethodKind.Ordinary, invoke.RefKind, DeclarationModifiers.Virtual | DeclarationModifiers.Public)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (16)
36var methodKind = interfaceSpecifier == null
37? MethodKind.Ordinary
38: MethodKind.ExplicitInterfaceImplementation;
52MethodKind methodKind,
76ModifierUtils.CheckAccessibility(this.DeclarationModifiers, this, isExplicitInterfaceImplementation: methodKind == MethodKind.ExplicitInterfaceImplementation, diagnostics, location);
90NamedTypeSymbol containingType, Location location, MethodDeclarationSyntax syntax, MethodKind methodKind,
105isExplicitInterfaceImplementation: methodKind == MethodKind.ExplicitInterfaceImplementation,
635Debug.Assert(this.MethodKind != MethodKind.UserDefinedOperator, "SourceUserDefinedOperatorSymbolBase overrides this");
680CheckModifiers(MethodKind == MethodKind.ExplicitInterfaceImplementation, _location, diagnostics);
687private static (DeclarationModifiers mods, bool hasExplicitAccessMod) MakeModifiers(MethodDeclarationSyntax syntax, NamedTypeSymbol containingType, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics)
690bool isExplicitInterfaceImplementation = methodKind == MethodKind.ExplicitInterfaceImplementation;
768private static DeclarationModifiers AddImpliedModifiers(DeclarationModifiers mods, bool containingTypeIsInterface, MethodKind methodKind, bool hasBody)
775methodKind == MethodKind.ExplicitInterfaceImplementation);
777else if (methodKind == MethodKind.ExplicitInterfaceImplementation)
922MethodKind methodKind,
980MethodKind methodKind,
Binding\DocumentationCommentCrefBinder.vb (27)
904CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.TrueOperatorName, opInfo, useSiteInfo)
910CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.FalseOperatorName, opInfo, useSiteInfo)
916CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator,
925CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.UnaryPlusOperatorName, opInfo, useSiteInfo)
928CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.AdditionOperatorName, opInfo, useSiteInfo)
934CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.UnaryNegationOperatorName, opInfo, useSiteInfo)
937CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.SubtractionOperatorName, opInfo, useSiteInfo)
943CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.MultiplyOperatorName, opInfo, useSiteInfo)
949CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.DivisionOperatorName, opInfo, useSiteInfo)
955CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.IntegerDivisionOperatorName, opInfo, useSiteInfo)
961CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.ModulusOperatorName, opInfo, useSiteInfo)
967CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.ExponentOperatorName, opInfo, useSiteInfo)
973CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.EqualityOperatorName, opInfo, useSiteInfo)
979CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.InequalityOperatorName, opInfo, useSiteInfo)
985CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.LessThanOperatorName, opInfo, useSiteInfo)
991CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.GreaterThanOperatorName, opInfo, useSiteInfo)
997CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.LessThanOrEqualOperatorName, opInfo, useSiteInfo)
1003CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.GreaterThanOrEqualOperatorName, opInfo, useSiteInfo)
1009CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.LikeOperatorName, opInfo, useSiteInfo)
1015CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.ConcatenateOperatorName, opInfo, useSiteInfo)
1021CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator,
1030CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator,
1039CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator, WellKnownMemberNames.ExclusiveOrOperatorName, opInfo, useSiteInfo)
1045CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator,
1054CollectOperatorsAndConversionsInType(type, symbols, MethodKind.UserDefinedOperator,
1063CollectOperatorsAndConversionsInType(type, symbols, MethodKind.Conversion,
1076kind As MethodKind,
Semantics\Operators.vb (29)
2814Debug.Assert(method.MethodKind = MethodKind.Conversion)
2836CollectUserDefinedOperators(source, destination, MethodKind.Conversion,
2850opKind As MethodKind,
2911opKind As MethodKind,
2955CollectUserDefinedOperators(argument.Type, Nothing, MethodKind.UserDefinedOperator,
2969CollectUserDefinedOperators(argument.Type, Nothing, MethodKind.UserDefinedOperator,
2992CollectUserDefinedOperators(argument.Type, Nothing, MethodKind.UserDefinedOperator,
2997CollectUserDefinedOperators(argument.Type, Nothing, MethodKind.UserDefinedOperator,
3002CollectUserDefinedOperators(argument.Type, Nothing, MethodKind.UserDefinedOperator,
3028CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3033CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3038CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3043CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3048CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3053CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3058CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3063CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3068CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3073CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3078CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3083CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3088CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3093CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3098CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3104CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3111CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3116CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3122CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
3128CollectUserDefinedOperators(left.Type, right.Type, MethodKind.UserDefinedOperator,
SymbolDisplay\SymbolDisplayVisitor.Members.vb (40)
170If symbol.MethodKind = MethodKind.ReducedExtension AndAlso Format.ExtensionMethodStyle = SymbolDisplayExtensionMethodStyle.StaticMethod Then
172ElseIf symbol.MethodKind <> MethodKind.ReducedExtension AndAlso Format.ExtensionMethodStyle = SymbolDisplayExtensionMethodStyle.InstanceMethod Then
197Case MethodKind.Constructor, MethodKind.StaticConstructor
201Case MethodKind.PropertyGet
212Case MethodKind.PropertySet
223Case MethodKind.EventAdd,
224MethodKind.EventRemove,
225MethodKind.EventRaise
233symbol.MethodKind = MethodKind.EventAdd,
236symbol.MethodKind = MethodKind.EventRemove,
244Case MethodKind.Conversion
259Case MethodKind.UserDefinedOperator, MethodKind.BuiltinOperator
270Case MethodKind.Ordinary,
271MethodKind.DelegateInvoke,
272MethodKind.ReducedExtension,
273MethodKind.AnonymousFunction
296If symbol.MethodKind = MethodKind.ReducedExtension Then
311Case MethodKind.Ordinary, MethodKind.DelegateInvoke, MethodKind.DeclareMethod
314Case MethodKind.ReducedExtension
319Case MethodKind.PropertyGet,
320MethodKind.PropertySet,
321MethodKind.EventAdd,
322MethodKind.EventRemove,
323MethodKind.EventRaise
338Case MethodKind.Constructor, MethodKind.StaticConstructor
345Case MethodKind.UserDefinedOperator, MethodKind.BuiltinOperator
361Case MethodKind.Conversion
370Case MethodKind.AnonymousFunction
383If symbol.MethodKind = MethodKind.BuiltinOperator Then
427AddParametersIfRequired(isExtensionMethod:=method.IsExtensionMethod AndAlso method.MethodKind <> MethodKind.ReducedExtension,
436Case MethodKind.Constructor,
437MethodKind.StaticConstructor
687Return vbMethod IsNot Nothing AndAlso vbMethod.MethodKind = MethodKind.DeclareMethod
701DirectCast(symbol, IMethodSymbol).MethodKind = MethodKind.AnonymousFunction OrElse
Symbols\Metadata\PE\PEMethodSymbol.vb (50)
88Public Property MethodKind As MethodKind
90Return CType((_bits >> s_methodKindOffset) And s_methodKindMask, MethodKind)
92Set(value As MethodKind)
162Public Sub InitializeMethodKind(methodKind As MethodKind)
357Public Overrides ReadOnly Property MethodKind As MethodKind
374Private Function ComputeMethodKind() As MethodKind
396Return MethodKind.SharedConstructor
399Return MethodKind.Constructor
403Return MethodKind.Ordinary
417Return MethodKind.Ordinary
422Return MethodKind.DelegateInvoke
425Return MethodKind.Ordinary
430Return _packedFlags.MethodKind = MethodKind.Constructor AndAlso ParameterCount = 0
445_packedFlags.MethodKind = MethodKind.Constructor
452Private Function ComputeMethodKindForPotentialOperatorOrConversion(opInfo As OverloadResolution.OperatorInfo) As MethodKind
458Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.Conversion, WellKnownMemberNames.ExplicitConversionName, True)
460Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.Conversion, WellKnownMemberNames.ImplicitConversionName, True)
462Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
465Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
467Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.OnesComplementOperatorName, False)
491Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
495Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
497Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.BitwiseAndOperatorName, False)
501Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
503Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.BitwiseOrOperatorName, False)
507Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
509Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.LeftShiftOperatorName, False)
513Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
515Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.RightShiftOperatorName, False)
532potentialMethodKind As MethodKind,
535) As MethodKind
536Debug.Assert(potentialMethodKind = MethodKind.Conversion OrElse potentialMethodKind = MethodKind.UserDefinedOperator)
538Dim result As MethodKind = potentialMethodKind
560Case MethodKind.Ordinary
573If potentialMethodKind = MethodKind.Conversion AndAlso Not outputType.IsSameTypeIgnoringAll(contender.ReturnType) Then
589result = MethodKind.Ordinary
593contender._packedFlags.InitializeMethodKind(MethodKind.Ordinary)
677Me.MethodKind = MethodKind.Ordinary AndAlso
924Me.MethodKind = MethodKind.PropertySet AndAlso
1007Friend Function SetAssociatedProperty(propertySymbol As PEPropertySymbol, methodKind As MethodKind) As Boolean
1008Debug.Assert((methodKind = MethodKind.PropertyGet) OrElse (methodKind = MethodKind.PropertySet))
1016Friend Function SetAssociatedEvent(eventSymbol As PEEventSymbol, methodKind As MethodKind) As Boolean
1017Debug.Assert((methodKind = MethodKind.EventAdd) OrElse (methodKind = MethodKind.EventRemove) OrElse (methodKind = MethodKind.EventRaise))
1021Private Function SetAssociatedPropertyOrEvent(propertyOrEventSymbol As Symbol, methodKind As MethodKind) As Boolean
1272MethodKind = MethodKind.Constructor AndAlso
1372If MethodKind <> MethodKind.Constructor Then
Symbols\Source\OverrideHidingHelper.vb (17)
497Case MethodKind.LambdaMethod, MethodKind.Constructor, MethodKind.SharedConstructor
499Case MethodKind.Conversion, MethodKind.DelegateInvoke, MethodKind.UserDefinedOperator, MethodKind.Ordinary, MethodKind.DeclareMethod,
500MethodKind.EventAdd, MethodKind.EventRaise, MethodKind.EventRemove,
501MethodKind.PropertyGet, MethodKind.PropertySet
626(DirectCast(DirectCast(overridingSym, Symbol), MethodSymbol).MethodKind = MethodKind.PropertyGet OrElse
627DirectCast(DirectCast(overridingSym, Symbol), MethodSymbol).MethodKind = MethodKind.PropertySet)))
688(DirectCast(DirectCast(overridingSym, Symbol), MethodSymbol).MethodKind = MethodKind.PropertyGet OrElse
689DirectCast(DirectCast(overridingSym, Symbol), MethodSymbol).MethodKind = MethodKind.PropertySet)))
Symbols\Source\SourceMethodSymbol.vb (30)
629Public Overrides ReadOnly Property MethodKind As MethodKind
1274Debug.Assert(Me.MethodKind <> MethodKind.EventAdd,
1499If Not (Me.MethodKind <> MethodKind.Ordinary AndAlso Me.MethodKind <> MethodKind.DeclareMethod) AndAlso
1623If Me.MethodKind <> MethodKind.Ordinary AndAlso Me.MethodKind <> MethodKind.DeclareMethod Then
1808Case MethodKind.DeclareMethod
1812Case MethodKind.PropertyGet, MethodKind.PropertySet
1816Case MethodKind.EventAdd, MethodKind.EventRaise, MethodKind.EventRemove
1900Debug.Assert(MethodKind <> MethodKind.DeclareMethod)
1991Case MethodKind.Constructor,
1992MethodKind.SharedConstructor,
1993MethodKind.PropertyGet,
1994MethodKind.PropertySet,
1995MethodKind.EventAdd,
1996MethodKind.EventRemove,
1997MethodKind.EventRaise,
1998MethodKind.Conversion,
1999MethodKind.UserDefinedOperator
2286Case MethodKind.Constructor,
2287MethodKind.SharedConstructor,
2288MethodKind.EventRemove,
2289MethodKind.EventRaise
2294Case MethodKind.EventAdd
2300Case MethodKind.PropertyGet, MethodKind.PropertySet
2322If Me.MethodKind = MethodKind.UserDefinedOperator Then
Symbols\Source\SourceNamedTypeSymbol_GroupClass.vb (2)
402ConflictsWithExistingMemberOrType(binder.GetAccessorName(propertyName, MethodKind.PropertyGet, False), membersBuilder, nestedTypes, conflictsWith) OrElse
403(disposeMethod.Length > 0 AndAlso ConflictsWithExistingMemberOrType(binder.GetAccessorName(propertyName, MethodKind.PropertySet, isWinMd), membersBuilder, nestedTypes, conflictsWith)) OrElse
Symbols\Symbol_Attributes.vb (12)
74Case MethodKind.Constructor,
75MethodKind.SharedConstructor
78Case MethodKind.Ordinary,
79MethodKind.DeclareMethod,
80MethodKind.UserDefinedOperator,
81MethodKind.Conversion,
82MethodKind.PropertyGet,
83MethodKind.PropertySet,
84MethodKind.EventAdd,
85MethodKind.EventRaise,
86MethodKind.EventRemove,
87MethodKind.DelegateInvoke