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)
86Public Property MethodKind As MethodKind
88Return CType((_bits >> s_methodKindOffset) And s_methodKindMask, MethodKind)
90Set(value As MethodKind)
160Public Sub InitializeMethodKind(methodKind As MethodKind)
344Public Overrides ReadOnly Property MethodKind As MethodKind
361Private Function ComputeMethodKind() As MethodKind
383Return MethodKind.SharedConstructor
386Return MethodKind.Constructor
390Return MethodKind.Ordinary
404Return MethodKind.Ordinary
409Return MethodKind.DelegateInvoke
412Return MethodKind.Ordinary
417Return _packedFlags.MethodKind = MethodKind.Constructor AndAlso ParameterCount = 0
432_packedFlags.MethodKind = MethodKind.Constructor
439Private Function ComputeMethodKindForPotentialOperatorOrConversion(opInfo As OverloadResolution.OperatorInfo) As MethodKind
445Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.Conversion, WellKnownMemberNames.ExplicitConversionName, True)
447Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.Conversion, WellKnownMemberNames.ImplicitConversionName, True)
449Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
452Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
454Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.OnesComplementOperatorName, False)
478Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
482Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
484Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.BitwiseAndOperatorName, False)
488Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
490Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.BitwiseOrOperatorName, False)
494Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
496Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.LeftShiftOperatorName, False)
500Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, Nothing, False)
502Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.UserDefinedOperator, WellKnownMemberNames.RightShiftOperatorName, False)
519potentialMethodKind As MethodKind,
522) As MethodKind
523Debug.Assert(potentialMethodKind = MethodKind.Conversion OrElse potentialMethodKind = MethodKind.UserDefinedOperator)
525Dim result As MethodKind = potentialMethodKind
547Case MethodKind.Ordinary
560If potentialMethodKind = MethodKind.Conversion AndAlso Not outputType.IsSameTypeIgnoringAll(contender.ReturnType) Then
576result = MethodKind.Ordinary
580contender._packedFlags.InitializeMethodKind(MethodKind.Ordinary)
664Me.MethodKind = MethodKind.Ordinary AndAlso
891Me.MethodKind = MethodKind.PropertySet AndAlso
974Friend Function SetAssociatedProperty(propertySymbol As PEPropertySymbol, methodKind As MethodKind) As Boolean
975Debug.Assert((methodKind = MethodKind.PropertyGet) OrElse (methodKind = MethodKind.PropertySet))
983Friend Function SetAssociatedEvent(eventSymbol As PEEventSymbol, methodKind As MethodKind) As Boolean
984Debug.Assert((methodKind = MethodKind.EventAdd) OrElse (methodKind = MethodKind.EventRemove) OrElse (methodKind = MethodKind.EventRaise))
988Private Function SetAssociatedPropertyOrEvent(propertyOrEventSymbol As Symbol, methodKind As MethodKind) As Boolean
1239MethodKind = MethodKind.Constructor AndAlso
1339If MethodKind <> MethodKind.Constructor Then
Symbols\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
1603If Me.MethodKind <> MethodKind.Ordinary AndAlso Me.MethodKind <> MethodKind.DeclareMethod Then
1775Case MethodKind.DeclareMethod
1779Case MethodKind.PropertyGet, MethodKind.PropertySet
1783Case MethodKind.EventAdd, MethodKind.EventRaise, MethodKind.EventRemove
1867Debug.Assert(MethodKind <> MethodKind.DeclareMethod)
1958Case MethodKind.Constructor,
1959MethodKind.SharedConstructor,
1960MethodKind.PropertyGet,
1961MethodKind.PropertySet,
1962MethodKind.EventAdd,
1963MethodKind.EventRemove,
1964MethodKind.EventRaise,
1965MethodKind.Conversion,
1966MethodKind.UserDefinedOperator
2253Case MethodKind.Constructor,
2254MethodKind.SharedConstructor,
2255MethodKind.EventRemove,
2256MethodKind.EventRaise
2261Case MethodKind.EventAdd
2267Case MethodKind.PropertyGet, MethodKind.PropertySet
2289If Me.MethodKind = MethodKind.UserDefinedOperator Then
Symbols\Source\SourceNamedTypeSymbol_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