743 references to DeclarationModifiers
Microsoft.CodeAnalysis.CSharp (743)
Binder\ExpressionVariableFinder.cs (4)
677private DeclarationModifiers _modifiers; 684DeclarationModifiers modifiers, 700finder._modifiers = DeclarationModifiers.None; 728modifiers: DeclarationModifiers.Private,
Declarations\DeclarationTreeBuilder.cs (10)
222modifiers: DeclarationModifiers.Internal | DeclarationModifiers.Partial | DeclarationModifiers.Sealed, 247modifiers: DeclarationModifiers.Partial, 337modifiers: DeclarationModifiers.Internal | DeclarationModifiers.Partial | DeclarationModifiers.Sealed, 750var modifiers = node.Modifiers.ToDeclarationModifiers(isForTypeDeclaration: true, diagnostics: diagnostics); 814var modifiers = node.Modifiers.ToDeclarationModifiers(isForTypeDeclaration: true, diagnostics: diagnostics); 847var modifiers = node.Modifiers.ToDeclarationModifiers(isForTypeDeclaration: true, diagnostics: diagnostics);
Declarations\SingleTypeDeclaration.cs (5)
22private readonly DeclarationModifiers _modifiers; 76DeclarationModifiers modifiers, 121public DeclarationModifiers Modifiers 256&& ((thisDecl.Modifiers & DeclarationModifiers.File) != 0 257|| (otherDecl.Modifiers & DeclarationModifiers.File) != 0))
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (7)
157private static DeclarationModifiers MakeDeclarationModifiers(ClosureKind closureKind, MethodSymbol originalMethod) 159var mods = closureKind == ClosureKind.ThisOnly ? DeclarationModifiers.Private : DeclarationModifiers.Internal; 163mods |= DeclarationModifiers.Static; 168mods |= DeclarationModifiers.Async; 173mods |= DeclarationModifiers.Extern;
Lowering\MethodToClassRewriter.cs (1)
738: base(containingType, methodBeingWrapped, syntax.SyntaxTree.GetReference(syntax), syntax.GetLocation(), name, DeclarationModifiers.Private,
Lowering\SynthesizedMethodBaseSymbol.cs (1)
37DeclarationModifiers declarationModifiers,
Parser\LanguageParser.cs (41)
1291private static DeclarationModifiers GetModifierExcludingScoped(SyntaxToken token) 1294internal static DeclarationModifiers GetModifierExcludingScoped(SyntaxKind kind, SyntaxKind contextualKind) 1299return DeclarationModifiers.Public; 1301return DeclarationModifiers.Internal; 1303return DeclarationModifiers.Protected; 1305return DeclarationModifiers.Private; 1307return DeclarationModifiers.Sealed; 1309return DeclarationModifiers.Abstract; 1311return DeclarationModifiers.Static; 1313return DeclarationModifiers.Virtual; 1315return DeclarationModifiers.Extern; 1317return DeclarationModifiers.New; 1319return DeclarationModifiers.Override; 1321return DeclarationModifiers.ReadOnly; 1323return DeclarationModifiers.Volatile; 1325return DeclarationModifiers.Unsafe; 1327return DeclarationModifiers.Partial; 1329return DeclarationModifiers.Async; 1331return DeclarationModifiers.Ref; 1336return DeclarationModifiers.Partial; 1338return DeclarationModifiers.Async; 1340return DeclarationModifiers.Required; 1342return DeclarationModifiers.File; 1347return DeclarationModifiers.None; 1359var newMod = GetModifierExcludingScoped(this.CurrentToken); 1361Debug.Assert(newMod != DeclarationModifiers.Scoped); 1362if (newMod == DeclarationModifiers.None) 1381case DeclarationModifiers.Partial: 1395(IsPossibleStartOfTypeDeclaration(nextToken.Kind) && GetModifierExcludingScoped(nextToken) != DeclarationModifiers.None)) 1407case DeclarationModifiers.Ref: 1432case DeclarationModifiers.File: 1442case DeclarationModifiers.Async: 1451case DeclarationModifiers.Required: 1496Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IdentifierToken && GetModifierExcludingScoped(this.CurrentToken) != DeclarationModifiers.None); 1609return !SyntaxFacts.IsContextualKeyword(nextToken.ContextualKind) && GetModifierExcludingScoped(nextToken) != DeclarationModifiers.None; 2901if (GetModifierExcludingScoped(this.CurrentToken) != DeclarationModifiers.None && 4187if (GetModifierExcludingScoped(this.CurrentToken) == DeclarationModifiers.None) 4193while (GetModifierExcludingScoped(this.PeekToken(peekIndex)) != DeclarationModifiers.None) 8553DeclarationModifiers modifier = GetModifierExcludingScoped(nextToken); 8554if (modifier == DeclarationModifiers.Partial) 8568else if (modifier != DeclarationModifiers.None)
Symbols\AliasSymbol.cs (1)
388this.CheckUnsafeModifier(DeclarationModifiers.Unsafe, usingDirective.UnsafeKeyword.GetLocation(), diagnostics);
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (6)
24protected abstract DeclarationModifiers Modifiers { get; } 46=> (Modifiers & DeclarationModifiers.Static) != 0; 49=> (Modifiers & DeclarationModifiers.ReadOnly) != 0; 55=> (Modifiers & DeclarationModifiers.Const) != 0; 58=> (Modifiers & DeclarationModifiers.Volatile) != 0; 61=> (Modifiers & DeclarationModifiers.Fixed) != 0;
Symbols\Source\GlobalExpressionVariable.cs (3)
30DeclarationModifiers modifiers, 43DeclarationModifiers modifiers, 169DeclarationModifiers modifiers,
Symbols\Source\LocalFunctionSymbol.cs (10)
20private readonly DeclarationModifiers _declarationModifiers; 50DeclarationModifiers.Private | 357public override bool IsAsync => (_declarationModifiers & DeclarationModifiers.Async) != 0; 359public override bool IsStatic => (_declarationModifiers & DeclarationModifiers.Static) != 0; 361public override bool IsVirtual => (_declarationModifiers & DeclarationModifiers.Virtual) != 0; 363public override bool IsOverride => (_declarationModifiers & DeclarationModifiers.Override) != 0; 365public override bool IsAbstract => (_declarationModifiers & DeclarationModifiers.Abstract) != 0; 367public override bool IsSealed => (_declarationModifiers & DeclarationModifiers.Sealed) != 0; 369public override bool IsExtern => (_declarationModifiers & DeclarationModifiers.Extern) != 0; 371public bool IsUnsafe => (_declarationModifiers & DeclarationModifiers.Unsafe) != 0;
Symbols\Source\ModifierUtils.cs (167)
15internal static DeclarationModifiers MakeAndCheckNonTypeMemberModifiers( 19DeclarationModifiers defaultAccess, 20DeclarationModifiers allowedModifiers, 25var result = modifiers.ToDeclarationModifiers(isForTypeDeclaration: false, diagnostics.DiagnosticBag ?? new DiagnosticBag(), isOrdinaryMethod: isOrdinaryMethod); 32if ((result & DeclarationModifiers.AccessibilityMask) == 0) 38internal static DeclarationModifiers CheckModifiers( 41DeclarationModifiers modifiers, 42DeclarationModifiers allowedModifiers, 51DeclarationModifiers reportStaticNotVirtualForModifiers = DeclarationModifiers.None; 55Debug.Assert((allowedModifiers & (DeclarationModifiers.Override | DeclarationModifiers.Virtual)) == 0); 57else if ((modifiers & allowedModifiers & DeclarationModifiers.Static) != 0) 61reportStaticNotVirtualForModifiers = allowedModifiers & DeclarationModifiers.Override; 65reportStaticNotVirtualForModifiers = allowedModifiers & (DeclarationModifiers.Abstract | DeclarationModifiers.Override | DeclarationModifiers.Virtual); 71DeclarationModifiers errorModifiers = modifiers & ~allowedModifiers; 72DeclarationModifiers result = modifiers & allowedModifiers; 74while (errorModifiers != DeclarationModifiers.None) 76DeclarationModifiers oneError = errorModifiers & ~(errorModifiers - 1); 77Debug.Assert(oneError != DeclarationModifiers.None); 82case DeclarationModifiers.Partial: 87case DeclarationModifiers.Abstract: 88case DeclarationModifiers.Override: 89case DeclarationModifiers.Virtual: 107checkFeature(DeclarationModifiers.PrivateProtected, MessageID.IDS_FeaturePrivateProtected) | 108checkFeature(DeclarationModifiers.Required, MessageID.IDS_FeatureRequiredMembers) | 109checkFeature(DeclarationModifiers.File, MessageID.IDS_FeatureFileTypes) | 110checkFeature(DeclarationModifiers.Async, MessageID.IDS_FeatureAsync); 114bool checkFeature(DeclarationModifiers modifier, MessageID featureID) 146DeclarationModifiers modifiers, 147DeclarationModifiers defaultInterfaceImplementationModifiers, 156if ((modifiers & defaultInterfaceImplementationModifiers & DeclarationModifiers.Static) != 0 && 157(modifiers & defaultInterfaceImplementationModifiers & (DeclarationModifiers.Sealed | DeclarationModifiers.Abstract | DeclarationModifiers.Virtual)) != 0) 159var reportModifiers = DeclarationModifiers.Sealed | DeclarationModifiers.Abstract | DeclarationModifiers.Virtual; 160if ((modifiers & defaultInterfaceImplementationModifiers & DeclarationModifiers.Sealed) != 0 && 161(modifiers & defaultInterfaceImplementationModifiers & (DeclarationModifiers.Abstract | DeclarationModifiers.Virtual)) != 0) 163diagnostics.Add(ErrorCode.ERR_BadMemberFlag, errorLocation, ConvertSingleModifierToSyntaxText(DeclarationModifiers.Sealed)); 164reportModifiers &= ~DeclarationModifiers.Sealed; 178if ((modifiers & defaultInterfaceImplementationModifiers & DeclarationModifiers.Static) != 0) 194internal static void ReportUnsupportedModifiersForLanguageVersion(DeclarationModifiers modifiers, DeclarationModifiers unsupportedModifiers, Location errorLocation, BindingDiagnosticBag diagnostics, LanguageVersion availableVersion, LanguageVersion requiredVersion) 196DeclarationModifiers errorModifiers = modifiers & unsupportedModifiers; 199while (errorModifiers != DeclarationModifiers.None) 201DeclarationModifiers oneError = errorModifiers & ~(errorModifiers - 1); 202Debug.Assert(oneError != DeclarationModifiers.None); 211internal static void CheckFeatureAvailabilityForStaticAbstractMembersInInterfacesIfNeeded(DeclarationModifiers mods, bool isExplicitInterfaceImplementation, Location location, BindingDiagnosticBag diagnostics) 213if (isExplicitInterfaceImplementation && (mods & DeclarationModifiers.Static) != 0) 221ModifierUtils.ReportUnsupportedModifiersForLanguageVersion(mods, DeclarationModifiers.Static, location, diagnostics, availableVersion, requiredVersion); 226internal static DeclarationModifiers AdjustModifiersForAnInterfaceMember(DeclarationModifiers mods, bool hasBody, bool isExplicitInterfaceImplementation) 230if ((mods & DeclarationModifiers.Abstract) != 0) 232mods |= DeclarationModifiers.Sealed; 235else if ((mods & DeclarationModifiers.Static) != 0) 237mods &= ~DeclarationModifiers.Sealed; 239else if ((mods & (DeclarationModifiers.Private | DeclarationModifiers.Partial | DeclarationModifiers.Virtual | DeclarationModifiers.Abstract)) == 0) 243if (hasBody || (mods & (DeclarationModifiers.Extern | DeclarationModifiers.Sealed)) != 0) 245if ((mods & DeclarationModifiers.Sealed) == 0) 247mods |= DeclarationModifiers.Virtual; 251mods &= ~DeclarationModifiers.Sealed; 256mods |= DeclarationModifiers.Abstract; 260if ((mods & DeclarationModifiers.AccessibilityMask) == 0) 262if ((mods & DeclarationModifiers.Partial) == 0 && !isExplicitInterfaceImplementation) 264mods |= DeclarationModifiers.Public; 268mods |= DeclarationModifiers.Private; 275internal static string ConvertSingleModifierToSyntaxText(DeclarationModifiers modifier) 279case DeclarationModifiers.Abstract: 281case DeclarationModifiers.Sealed: 283case DeclarationModifiers.Static: 285case DeclarationModifiers.New: 287case DeclarationModifiers.Public: 289case DeclarationModifiers.Protected: 291case DeclarationModifiers.Internal: 293case DeclarationModifiers.ProtectedInternal: 295case DeclarationModifiers.Private: 297case DeclarationModifiers.PrivateProtected: 299case DeclarationModifiers.ReadOnly: 301case DeclarationModifiers.Const: 303case DeclarationModifiers.Volatile: 305case DeclarationModifiers.Extern: 307case DeclarationModifiers.Partial: 309case DeclarationModifiers.Unsafe: 311case DeclarationModifiers.Fixed: 313case DeclarationModifiers.Virtual: 315case DeclarationModifiers.Override: 317case DeclarationModifiers.Async: 319case DeclarationModifiers.Ref: 321case DeclarationModifiers.Required: 323case DeclarationModifiers.Scoped: 325case DeclarationModifiers.File: 332private static DeclarationModifiers ToDeclarationModifier(SyntaxKind kind) 337return DeclarationModifiers.Abstract; 339return DeclarationModifiers.Async; 341return DeclarationModifiers.Sealed; 343return DeclarationModifiers.Static; 345return DeclarationModifiers.New; 347return DeclarationModifiers.Public; 349return DeclarationModifiers.Protected; 351return DeclarationModifiers.Internal; 353return DeclarationModifiers.Private; 355return DeclarationModifiers.Extern; 357return DeclarationModifiers.ReadOnly; 359return DeclarationModifiers.Partial; 361return DeclarationModifiers.Unsafe; 363return DeclarationModifiers.Virtual; 365return DeclarationModifiers.Override; 367return DeclarationModifiers.Const; 369return DeclarationModifiers.Fixed; 371return DeclarationModifiers.Volatile; 373return DeclarationModifiers.Ref; 375return DeclarationModifiers.Required; 377return DeclarationModifiers.Scoped; 379return DeclarationModifiers.File; 385public static DeclarationModifiers ToDeclarationModifiers( 388var result = DeclarationModifiers.None; 394DeclarationModifiers one = ToDeclarationModifier(modifier.ContextualKind()); 401if (one == DeclarationModifiers.Partial) 422switch (result & DeclarationModifiers.AccessibilityMask) 424case DeclarationModifiers.Protected | DeclarationModifiers.Internal: 426result &= ~DeclarationModifiers.AccessibilityMask; 427result |= DeclarationModifiers.ProtectedInternal; 430case DeclarationModifiers.Private | DeclarationModifiers.Protected: 432result &= ~DeclarationModifiers.AccessibilityMask; 433result |= DeclarationModifiers.PrivateProtected; 442DeclarationModifiers modifierKind, 443DeclarationModifiers allModifiers, 460internal static bool CheckAccessibility(DeclarationModifiers modifiers, Symbol symbol, bool isExplicitInterfaceImplementation, BindingDiagnosticBag diagnostics, Location errorLocation) 470(symbol.Kind != SymbolKind.Method || (modifiers & DeclarationModifiers.Partial) == 0) && 471(modifiers & DeclarationModifiers.Static) == 0) 473switch (modifiers & DeclarationModifiers.AccessibilityMask) 475case DeclarationModifiers.Protected: 476case DeclarationModifiers.ProtectedInternal: 477case DeclarationModifiers.PrivateProtected: 488if ((modifiers & DeclarationModifiers.Required) != 0) 502case FieldSymbol when (modifiers & DeclarationModifiers.ReadOnly) != 0: 518internal static Accessibility EffectiveAccessibility(DeclarationModifiers modifiers) 520switch (modifiers & DeclarationModifiers.AccessibilityMask) 522case DeclarationModifiers.None: 524case DeclarationModifiers.Private: 526case DeclarationModifiers.Protected: 528case DeclarationModifiers.Internal: 530case DeclarationModifiers.Public: 532case DeclarationModifiers.ProtectedInternal: 534case DeclarationModifiers.PrivateProtected: 544internal static bool IsValidAccessibility(DeclarationModifiers modifiers) 546switch (modifiers & DeclarationModifiers.AccessibilityMask) 548case DeclarationModifiers.None: 549case DeclarationModifiers.Private: 550case DeclarationModifiers.Protected: 551case DeclarationModifiers.Internal: 552case DeclarationModifiers.Public: 553case DeclarationModifiers.ProtectedInternal: 554case DeclarationModifiers.PrivateProtected:
Symbols\Source\SourceConstructorSymbol.cs (16)
80private static (DeclarationModifiers, Flags) MakeModifiersAndFlags( 91DeclarationModifiers declarationModifiers = MakeModifiers(containingType, syntax, methodKind, syntax.HasAnyBody(), location, diagnostics, out modifierErrors, out report_ERR_StaticConstructorWithAccessModifiers); 122private static DeclarationModifiers MakeModifiers( 126var defaultAccess = (methodKind == MethodKind.StaticConstructor) ? DeclarationModifiers.None : DeclarationModifiers.Private; 129const DeclarationModifiers allowedModifiers = 130DeclarationModifiers.AccessibilityMask | 131DeclarationModifiers.Static | 132DeclarationModifiers.Extern | 133DeclarationModifiers.Unsafe; 136var mods = ModifierUtils.MakeAndCheckNonTypeMemberModifiers(isOrdinaryMethod: false, isForInterfaceMember: isInterface, syntax.Modifiers, defaultAccess, allowedModifiers, location, diagnostics, out modifierErrors); 144if ((mods & DeclarationModifiers.AccessibilityMask) != 0 && 147mods = mods & ~DeclarationModifiers.AccessibilityMask; 152mods |= DeclarationModifiers.Private; // we mark static constructors private in the symbol table 157DeclarationModifiers.Extern,
Symbols\Source\SourceConstructorSymbolBase.cs (1)
27(DeclarationModifiers declarationModifiers, Flags flags) modifiersAndFlags)
Symbols\Source\SourceDelegateMethodSymbol.cs (8)
28DeclarationModifiers declarationModifiers) 217: base(delegateType, voidType, syntax, MethodKind.Constructor, RefKind.None, DeclarationModifiers.Public) 262: base(delegateType, returnType, syntax, MethodKind.DelegateInvoke, refKind, DeclarationModifiers.Virtual | DeclarationModifiers.Public) 355: base((SourceNamedTypeSymbol)invoke.ContainingType, iAsyncResultType, syntax, MethodKind.Ordinary, RefKind.None, DeclarationModifiers.Virtual | DeclarationModifiers.Public) 393: base((SourceNamedTypeSymbol)invoke.ContainingType, invoke.ReturnTypeWithAnnotations, syntax, MethodKind.Ordinary, invoke.RefKind, DeclarationModifiers.Virtual | DeclarationModifiers.Public)
Symbols\Source\SourceDestructorSymbol.cs (10)
64private static (DeclarationModifiers, Flags) MakeModifiersAndFlags(NamedTypeSymbol containingType, DestructorDeclarationSyntax syntax, bool isNullableAnalysisEnabled, Location location, BindingDiagnosticBag diagnostics, out bool modifierErrors) 66DeclarationModifiers declarationModifiers = MakeModifiers(containingType, syntax.Modifiers, location, diagnostics, out modifierErrors); 129private static DeclarationModifiers MakeModifiers(NamedTypeSymbol containingType, SyntaxTokenList modifiers, Location location, BindingDiagnosticBag diagnostics, out bool modifierErrors) 132const DeclarationModifiers allowedModifiers = DeclarationModifiers.Extern | DeclarationModifiers.Unsafe; 133var mods = ModifierUtils.MakeAndCheckNonTypeMemberModifiers(isOrdinaryMethod: false, isForInterfaceMember: containingType.IsInterface, modifiers, DeclarationModifiers.None, allowedModifiers, location, diagnostics, out modifierErrors); 135mods = (mods & ~DeclarationModifiers.AccessibilityMask) | DeclarationModifiers.Protected; // we mark destructors protected in the symbol table
Symbols\Source\SourceEnumConstantSymbol.cs (4)
73protected sealed override DeclarationModifiers Modifiers 77return DeclarationModifiers.Const | DeclarationModifiers.Static | DeclarationModifiers.Public;
Symbols\Source\SourceEventFieldSymbol.cs (2)
28(associatedEvent.Modifiers & (~DeclarationModifiers.AccessibilityMask)) | DeclarationModifiers.Private,
Symbols\Source\SourceEventSymbol.cs (38)
27private readonly DeclarationModifiers _modifiers; 370get { return (_modifiers & DeclarationModifiers.Abstract) != 0; } 375get { return (_modifiers & DeclarationModifiers.Extern) != 0; } 380get { return (_modifiers & DeclarationModifiers.Static) != 0; } 385get { return (_modifiers & DeclarationModifiers.Override) != 0; } 390get { return (_modifiers & DeclarationModifiers.Sealed) != 0; } 395get { return (_modifiers & DeclarationModifiers.Virtual) != 0; } 400get { return (_modifiers & DeclarationModifiers.ReadOnly) != 0; } 430get { return (_modifiers & DeclarationModifiers.New) != 0; } 433internal DeclarationModifiers Modifiers 443private DeclarationModifiers MakeModifiers(SyntaxTokenList modifiers, bool explicitInterfaceImplementation, 448var defaultAccess = isInterface && !explicitInterfaceImplementation ? DeclarationModifiers.Public : DeclarationModifiers.Private; 449var defaultInterfaceImplementationModifiers = DeclarationModifiers.None; 452var allowedModifiers = DeclarationModifiers.Unsafe; 455allowedModifiers |= DeclarationModifiers.New | 456DeclarationModifiers.Sealed | 457DeclarationModifiers.Abstract | 458DeclarationModifiers.Static | 459DeclarationModifiers.Virtual | 460DeclarationModifiers.AccessibilityMask; 464allowedModifiers |= DeclarationModifiers.Override; 470defaultAccess = DeclarationModifiers.None; 472allowedModifiers |= DeclarationModifiers.Extern; 473defaultInterfaceImplementationModifiers |= DeclarationModifiers.Sealed | 474DeclarationModifiers.Abstract | 475DeclarationModifiers.Static | 476DeclarationModifiers.Virtual | 477DeclarationModifiers.Extern | 478DeclarationModifiers.AccessibilityMask; 487allowedModifiers |= DeclarationModifiers.Abstract; 490allowedModifiers |= DeclarationModifiers.Static; 495allowedModifiers |= DeclarationModifiers.ReadOnly; 500allowedModifiers |= DeclarationModifiers.Extern; 503var mods = ModifierUtils.MakeAndCheckNonTypeMemberModifiers(isOrdinaryMethod: false, isForInterfaceMember: isInterface,
Symbols\Source\SourceFieldSymbol.cs (2)
45return (Modifiers & DeclarationModifiers.New) != 0; 164internal override bool IsRequired => (Modifiers & DeclarationModifiers.Required) != 0;
Symbols\Source\SourceFixedFieldSymbol.cs (1)
30DeclarationModifiers modifiers,
Symbols\Source\SourceMemberContainerSymbol.cs (73)
192private readonly DeclarationModifiers _declModifiers; 237var modifiers = MakeModifiers(typeKind, diagnostics); 244int access = (int)(modifiers & DeclarationModifiers.AccessibilityMask); 247if ((modifiers & DeclarationModifiers.Partial) != 0) 250modifiers &= ~DeclarationModifiers.AccessibilityMask; // remove them all 251modifiers |= (DeclarationModifiers)access; // except the one 255var specialType = access == (int)DeclarationModifiers.Public 289private DeclarationModifiers MakeModifiers(TypeKind typeKind, BindingDiagnosticBag diagnostics) 292DeclarationModifiers defaultAccess; 295var allowedModifiers = DeclarationModifiers.AccessibilityMask | DeclarationModifiers.File; 299defaultAccess = DeclarationModifiers.Internal; 303allowedModifiers |= DeclarationModifiers.New; 307defaultAccess = DeclarationModifiers.Public; 311defaultAccess = DeclarationModifiers.Private; 319allowedModifiers |= DeclarationModifiers.Partial | DeclarationModifiers.Sealed | DeclarationModifiers.Abstract 320| DeclarationModifiers.Unsafe; 324allowedModifiers |= DeclarationModifiers.Static; 329allowedModifiers |= DeclarationModifiers.Partial | DeclarationModifiers.ReadOnly | DeclarationModifiers.Unsafe; 333allowedModifiers |= DeclarationModifiers.Ref; 338allowedModifiers |= DeclarationModifiers.Partial | DeclarationModifiers.Unsafe; 341allowedModifiers |= DeclarationModifiers.Unsafe; 346var mods = MakeAndCheckTypeModifiers( 355(mods & DeclarationModifiers.Abstract) != 0 && 356(mods & (DeclarationModifiers.Sealed | DeclarationModifiers.Static)) != 0) 362(mods & (DeclarationModifiers.Sealed | DeclarationModifiers.Static)) == (DeclarationModifiers.Sealed | DeclarationModifiers.Static)) 370mods |= DeclarationModifiers.Abstract; 374mods |= DeclarationModifiers.Sealed; 377mods |= DeclarationModifiers.Sealed; 384private DeclarationModifiers MakeAndCheckTypeModifiers( 385DeclarationModifiers defaultAccess, 386DeclarationModifiers allowedModifiers, 392var result = DeclarationModifiers.Unset; 399var mods = decl.Modifiers; 401if (partCount > 1 && (mods & DeclarationModifiers.Partial) == 0) 420if (result == DeclarationModifiers.Unset) 431if ((result & DeclarationModifiers.AccessibilityMask) == 0) 435else if ((result & DeclarationModifiers.File) != 0) 442if ((result & DeclarationModifiers.Partial) == 0) 451diagnostics.Add((result & DeclarationModifiers.File) != 0 473var mods = singleDeclaration.Modifiers; 474if ((mods & DeclarationModifiers.Partial) == 0) 841public override bool IsStatic => HasFlag(DeclarationModifiers.Static); 843public sealed override bool IsRefLikeType => HasFlag(DeclarationModifiers.Ref); 845public override bool IsReadOnly => HasFlag(DeclarationModifiers.ReadOnly); 847public override bool IsSealed => HasFlag(DeclarationModifiers.Sealed); 849public override bool IsAbstract => HasFlag(DeclarationModifiers.Abstract); 851internal bool IsPartial => HasFlag(DeclarationModifiers.Partial); 853internal bool IsNew => HasFlag(DeclarationModifiers.New); 855internal sealed override bool IsFileLocal => HasFlag(DeclarationModifiers.File); 857internal bool IsUnsafe => HasFlag(DeclarationModifiers.Unsafe); 878private bool HasFlag(DeclarationModifiers flag) => (_declModifiers & flag) != 0; 4928var modifiers = SourceMemberFieldSymbol.MakeModifiers(this, fieldSyntax.Declaration.Variables[0].Identifier, fieldSyntax.Modifiers, isRefField: refKind != RefKind.None, diagnostics, out modifierErrors); 4931var fieldSymbol = (modifiers & DeclarationModifiers.Fixed) == 0 4943DeclarationModifiers.Private | (modifiers & DeclarationModifiers.Static), 5047DeclarationModifiers.Private | (property.IsStatic ? DeclarationModifiers.Static : 0), 5085DeclarationModifiers.Private | (@event.IsStatic ? DeclarationModifiers.Static : 0), 5208ExpressionFieldFinder.FindExpressionVariables(builder.NonTypeMembers, vdecl, this, DeclarationModifiers.Private, 5223DeclarationModifiers.Private,
Symbols\Source\SourceMemberFieldSymbol.cs (53)
22private readonly DeclarationModifiers _modifiers; 26DeclarationModifiers modifiers, 35protected sealed override DeclarationModifiers Modifiers 165internal static DeclarationModifiers MakeModifiers(NamedTypeSymbol containingType, SyntaxToken firstIdentifier, SyntaxTokenList modifiers, bool isRefField, BindingDiagnosticBag diagnostics, out bool modifierErrors) 168DeclarationModifiers defaultAccess = 169isInterface ? DeclarationModifiers.Public : DeclarationModifiers.Private; 171DeclarationModifiers allowedModifiers = 172DeclarationModifiers.AccessibilityMask | 173DeclarationModifiers.Const | 174DeclarationModifiers.New | 175DeclarationModifiers.ReadOnly | 176DeclarationModifiers.Static | 177DeclarationModifiers.Volatile | 178DeclarationModifiers.Fixed | 179DeclarationModifiers.Unsafe | 180DeclarationModifiers.Abstract | 181DeclarationModifiers.Required; // Some of these are filtered out later, when illegal, for better error messages. 184DeclarationModifiers result = ModifierUtils.MakeAndCheckNonTypeMemberModifiers( 188if ((result & DeclarationModifiers.Abstract) != 0) 191result &= ~DeclarationModifiers.Abstract; 194if ((result & DeclarationModifiers.Fixed) != 0) 202reportBadMemberFlagIfAny(result, DeclarationModifiers.Static, diagnostics, errorLocation); 203reportBadMemberFlagIfAny(result, DeclarationModifiers.ReadOnly, diagnostics, errorLocation); 204reportBadMemberFlagIfAny(result, DeclarationModifiers.Const, diagnostics, errorLocation); 205reportBadMemberFlagIfAny(result, DeclarationModifiers.Volatile, diagnostics, errorLocation); 206reportBadMemberFlagIfAny(result, DeclarationModifiers.Required, diagnostics, errorLocation); 208result &= ~(DeclarationModifiers.Static | DeclarationModifiers.ReadOnly | DeclarationModifiers.Const | DeclarationModifiers.Volatile | DeclarationModifiers.Required); 209Debug.Assert((result & ~(DeclarationModifiers.AccessibilityMask | DeclarationModifiers.Fixed | DeclarationModifiers.Unsafe | DeclarationModifiers.New)) == 0); 212if ((result & DeclarationModifiers.Const) != 0) 214if ((result & DeclarationModifiers.Static) != 0) 220reportBadMemberFlagIfAny(result, DeclarationModifiers.ReadOnly, diagnostics, errorLocation); 221reportBadMemberFlagIfAny(result, DeclarationModifiers.Volatile, diagnostics, errorLocation); 222reportBadMemberFlagIfAny(result, DeclarationModifiers.Unsafe, diagnostics, errorLocation); 224if (reportBadMemberFlagIfAny(result, DeclarationModifiers.Required, diagnostics, errorLocation)) 226result &= ~DeclarationModifiers.Required; 229result |= DeclarationModifiers.Static; // "constants are considered static members" 233if ((result & DeclarationModifiers.Static) != 0 && (result & DeclarationModifiers.Required) != 0) 237result &= ~DeclarationModifiers.Required; 250reportBadMemberFlagIfAny(result, DeclarationModifiers.Static, diagnostics, errorLocation); 251reportBadMemberFlagIfAny(result, DeclarationModifiers.Const, diagnostics, errorLocation); 252reportBadMemberFlagIfAny(result, DeclarationModifiers.Volatile, diagnostics, errorLocation); 257static bool reportBadMemberFlagIfAny(DeclarationModifiers result, DeclarationModifiers modifier, BindingDiagnosticBag diagnostics, SourceLocation errorLocation) 345DeclarationModifiers modifiers,
Symbols\Source\SourceMemberMethodSymbol.cs (21)
174private static bool ModifiersRequireMetadataVirtual(DeclarationModifiers modifiers) 176return (modifiers & (DeclarationModifiers.Abstract | DeclarationModifiers.Virtual | DeclarationModifiers.Override)) != 0; 182DeclarationModifiers declarationModifiers, 195bool isMetadataVirtual = (isExplicitInterfaceImplementation && (declarationModifiers & DeclarationModifiers.Static) == 0) || ModifiersRequireMetadataVirtual(declarationModifiers); 225DeclarationModifiers declarationModifiers, 292protected readonly DeclarationModifiers DeclarationModifiers; 325(DeclarationModifiers declarationModifiers, Flags flags) modifiersAndFlags) 396DeclarationModifiers declarationModifiers, 591return (this.DeclarationModifiers & DeclarationModifiers.Extern) != 0; 607return (this.DeclarationModifiers & DeclarationModifiers.Sealed) != 0; 615return (this.DeclarationModifiers & DeclarationModifiers.Abstract) != 0; 623return (this.DeclarationModifiers & DeclarationModifiers.Override) != 0; 631return (this.DeclarationModifiers & DeclarationModifiers.Partial) != 0; 639return (this.DeclarationModifiers & DeclarationModifiers.Virtual) != 0; 647return (this.DeclarationModifiers & DeclarationModifiers.New) != 0; 655return (this.DeclarationModifiers & DeclarationModifiers.Static) != 0; 663return (this.DeclarationModifiers & DeclarationModifiers.Unsafe) != 0; 671return (this.DeclarationModifiers & DeclarationModifiers.Async) != 0; 679return (this.DeclarationModifiers & DeclarationModifiers.ReadOnly) != 0;
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
746declaringSymbol.CheckUnsafeModifier(DeclarationModifiers.Unsafe, unsafeKeywordLocation, diagnostics);
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (1)
24protected SourceOrdinaryMethodOrUserDefinedOperatorSymbol(NamedTypeSymbol containingType, SyntaxReference syntaxReferenceOpt, Location location, bool isIterator, (DeclarationModifiers declarationModifiers, Flags flags) modifiersAndFlags)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (46)
89private static (DeclarationModifiers, Flags) MakeModifiersAndFlags( 93(DeclarationModifiers declarationModifiers, hasExplicitAccessMod) = MakeModifiers(syntax, containingType, methodKind, hasBody: syntax.HasAnyBody(), location, diagnostics); 424private static DeclarationModifiers MakeDeclarationModifiers(MethodDeclarationSyntax syntax, NamedTypeSymbol containingType, Location location, DeclarationModifiers allowedModifiers, BindingDiagnosticBag diagnostics) 427syntax.Modifiers, defaultAccess: DeclarationModifiers.None, allowedModifiers, location, diagnostics, out _); 687private static (DeclarationModifiers mods, bool hasExplicitAccessMod) MakeModifiers(MethodDeclarationSyntax syntax, NamedTypeSymbol containingType, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics) 694var defaultAccess = isInterface && !isExplicitInterfaceImplementation ? DeclarationModifiers.None : DeclarationModifiers.Private; 697var allowedModifiers = DeclarationModifiers.Partial | DeclarationModifiers.Unsafe; 698var defaultInterfaceImplementationModifiers = DeclarationModifiers.None; 702allowedModifiers |= DeclarationModifiers.New | 703DeclarationModifiers.Sealed | 704DeclarationModifiers.Abstract | 705DeclarationModifiers.Static | 706DeclarationModifiers.Virtual | 707DeclarationModifiers.AccessibilityMask; 711allowedModifiers |= DeclarationModifiers.Override; 715defaultInterfaceImplementationModifiers |= DeclarationModifiers.Sealed | 716DeclarationModifiers.Abstract | 717DeclarationModifiers.Static | 718DeclarationModifiers.Virtual | 719DeclarationModifiers.Extern | 720DeclarationModifiers.Async | 721DeclarationModifiers.Partial | 722DeclarationModifiers.AccessibilityMask; 731allowedModifiers |= DeclarationModifiers.Abstract; 734allowedModifiers |= DeclarationModifiers.Static; 737allowedModifiers |= DeclarationModifiers.Extern | DeclarationModifiers.Async; 741allowedModifiers |= DeclarationModifiers.ReadOnly; 747DeclarationModifiers mods = MakeDeclarationModifiers(syntax, containingType, location, allowedModifiers, diagnostics); 748if ((mods & DeclarationModifiers.AccessibilityMask) == 0) 768private static DeclarationModifiers AddImpliedModifiers(DeclarationModifiers mods, bool containingTypeIsInterface, MethodKind methodKind, bool hasBody) 779mods = (mods & ~DeclarationModifiers.AccessibilityMask) | DeclarationModifiers.Private; 784private const DeclarationModifiers PartialMethodExtendedModifierMask = 785DeclarationModifiers.Virtual | 786DeclarationModifiers.Override | 787DeclarationModifiers.New | 788DeclarationModifiers.Sealed | 789DeclarationModifiers.Extern;
Symbols\Source\SourceOrdinaryMethodSymbolBase.cs (1)
34(DeclarationModifiers declarationModifiers, Flags flags) modifiersAndFlags) :
Symbols\Source\SourcePropertyAccessorSymbol.cs (28)
31DeclarationModifiers propertyModifiers, 68DeclarationModifiers propertyModifiers, 89DeclarationModifiers propertyModifiers, 115DeclarationModifiers propertyModifiers, 142DeclarationModifiers propertyModifiers, 176DeclarationModifiers propertyModifiers, 222private static (DeclarationModifiers, Flags) MakeModifiersAndFlags( 223NamedTypeSymbol containingType, SourcePropertySymbolBase property, DeclarationModifiers propertyModifiers, Location location, 231var declarationModifiers = MakeModifiers(containingType, modifiers, isExplicitInterfaceImplementation, hasAnyBody, location, diagnostics, out modifierErrors); 234declarationModifiers |= GetAccessorModifiers(propertyModifiers) & ~DeclarationModifiers.AccessibilityMask; 235if ((declarationModifiers & DeclarationModifiers.Private) != 0) 238declarationModifiers &= ~DeclarationModifiers.Virtual; 251private static DeclarationModifiers GetAccessorModifiers(DeclarationModifiers propertyModifiers) => 252propertyModifiers & ~(DeclarationModifiers.Indexer | DeclarationModifiers.ReadOnly); 432internal bool LocalDeclaredReadOnly => (DeclarationModifiers & DeclarationModifiers.ReadOnly) != 0; 492private static DeclarationModifiers MakeModifiers(NamedTypeSymbol containingType, SyntaxTokenList modifiers, bool isExplicitInterfaceImplementation, 497const DeclarationModifiers defaultAccess = DeclarationModifiers.None; 500var allowedModifiers = isExplicitInterfaceImplementation ? DeclarationModifiers.None : DeclarationModifiers.AccessibilityMask; 503allowedModifiers |= DeclarationModifiers.ReadOnly; 506var defaultInterfaceImplementationModifiers = DeclarationModifiers.None; 511defaultInterfaceImplementationModifiers = DeclarationModifiers.AccessibilityMask; 514var mods = ModifierUtils.MakeAndCheckNonTypeMemberModifiers(isOrdinaryMethod: false, isForInterfaceMember: isInterface,
Symbols\Source\SourcePropertySymbol.cs (45)
69bool allowAutoPropertyAccessors = (modifiers & (DeclarationModifiers.Abstract | DeclarationModifiers.Extern | DeclarationModifiers.Indexer)) == 0 && 70(!containingType.IsInterface || hasGetAccessorImplementation || hasSetAccessorImplementation || (modifiers & DeclarationModifiers.Static) != 0) && 71((modifiers & DeclarationModifiers.Partial) == 0 || hasGetAccessorImplementation || hasSetAccessorImplementation); 109DeclarationModifiers modifiers, 358private static (DeclarationModifiers modifiers, bool hasExplicitAccessMod) MakeModifiers( 369var defaultAccess = isInterface && !isExplicitInterfaceImplementation ? DeclarationModifiers.Public : DeclarationModifiers.Private; 372var allowedModifiers = DeclarationModifiers.Partial | DeclarationModifiers.Unsafe; 373var defaultInterfaceImplementationModifiers = DeclarationModifiers.None; 377allowedModifiers |= DeclarationModifiers.New | 378DeclarationModifiers.Sealed | 379DeclarationModifiers.Abstract | 380DeclarationModifiers.Virtual | 381DeclarationModifiers.AccessibilityMask; 385allowedModifiers |= DeclarationModifiers.Static; 390allowedModifiers |= DeclarationModifiers.Override; 394allowedModifiers |= DeclarationModifiers.Required; 401defaultAccess = DeclarationModifiers.None; 403defaultInterfaceImplementationModifiers |= DeclarationModifiers.Sealed | 404DeclarationModifiers.Abstract | 405(isIndexer ? 0 : DeclarationModifiers.Static) | 406DeclarationModifiers.Virtual | 407DeclarationModifiers.Extern | 408DeclarationModifiers.AccessibilityMask; 417allowedModifiers |= DeclarationModifiers.Abstract; 422allowedModifiers |= DeclarationModifiers.Static; 428allowedModifiers |= DeclarationModifiers.ReadOnly; 431allowedModifiers |= DeclarationModifiers.Extern; 436var mods = ModifierUtils.MakeAndCheckNonTypeMemberModifiers(isOrdinaryMethod: false, isForInterfaceMember: isInterface, 437modifiers, defaultAccess: DeclarationModifiers.None, allowedModifiers, location, diagnostics, out modifierErrors); 438if ((mods & DeclarationModifiers.AccessibilityMask) == 0) 448if ((mods & DeclarationModifiers.Partial) != 0) 456ModifierUtils.ReportUnsupportedModifiersForLanguageVersion(mods, DeclarationModifiers.Partial, location, diagnostics, availableVersion, requiredVersion); 477mods |= DeclarationModifiers.Indexer; 480if ((mods & DeclarationModifiers.Static) != 0 && (mods & DeclarationModifiers.Required) != 0) 484mods &= ~DeclarationModifiers.Required; 730if ((_modifiers & DeclarationModifiers.Unsafe) != (implementation._modifiers & DeclarationModifiers.Unsafe) && this.CompilationAllowsUnsafe()) // Don't cascade.
Symbols\Source\SourcePropertySymbolBase.cs (14)
48protected readonly DeclarationModifiers _modifiers; 87DeclarationModifiers modifiers, 105Debug.Assert((modifiers & DeclarationModifiers.Required) == 0 || this is SourcePropertySymbol); 544get { return (_modifiers & DeclarationModifiers.Abstract) != 0; } 551return (_modifiers & DeclarationModifiers.Extern) != 0; 565get { return (_modifiers & DeclarationModifiers.Static) != 0; } 577get { return (_modifiers & DeclarationModifiers.Indexer) != 0; } 582get { return (_modifiers & DeclarationModifiers.Override) != 0; } 587get { return (_modifiers & DeclarationModifiers.Sealed) != 0; } 592get { return (_modifiers & DeclarationModifiers.Virtual) != 0; } 595internal sealed override bool IsRequired => (_modifiers & DeclarationModifiers.Required) != 0; 599get { return (_modifiers & DeclarationModifiers.New) != 0; } 602internal bool HasReadOnlyModifier => (_modifiers & DeclarationModifiers.ReadOnly) != 0; 1719internal bool IsPartial => (_modifiers & DeclarationModifiers.Partial) != 0;
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (33)
31DeclarationModifiers declarationModifiers, 125protected static DeclarationModifiers MakeDeclarationModifiers(MethodKind methodKind, bool inInterface, BaseMethodDeclarationSyntax syntax, Location location, BindingDiagnosticBag diagnostics) 128var defaultAccess = inInterface && !isExplicitInterfaceImplementation ? DeclarationModifiers.Public : DeclarationModifiers.Private; 129var allowedModifiers = 130DeclarationModifiers.Static | 131DeclarationModifiers.Extern | 132DeclarationModifiers.Unsafe; 136allowedModifiers |= DeclarationModifiers.AccessibilityMask; 140allowedModifiers |= DeclarationModifiers.Abstract | DeclarationModifiers.Virtual; 144allowedModifiers |= DeclarationModifiers.Sealed; 151allowedModifiers |= DeclarationModifiers.Abstract; 154var result = ModifierUtils.MakeAndCheckNonTypeMemberModifiers( 160if ((result & (DeclarationModifiers.Abstract | DeclarationModifiers.Virtual | DeclarationModifiers.Sealed)) != 0) 162if ((result & DeclarationModifiers.Sealed) != 0 && 163(result & (DeclarationModifiers.Abstract | DeclarationModifiers.Virtual)) != 0) 165diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, ModifierUtils.ConvertSingleModifierToSyntaxText(DeclarationModifiers.Sealed)); 166result &= ~DeclarationModifiers.Sealed; 177if ((result & DeclarationModifiers.Abstract) != 0) 179reportModifierIfPresent(result, DeclarationModifiers.Abstract, location, diagnostics, requiredVersionArgument, availableVersionArgument); 183reportModifierIfPresent(result, DeclarationModifiers.Virtual, location, diagnostics, requiredVersionArgument, availableVersionArgument); 186reportModifierIfPresent(result, DeclarationModifiers.Sealed, location, diagnostics, requiredVersionArgument, availableVersionArgument); 189result &= ~DeclarationModifiers.Sealed; 191else if ((result & DeclarationModifiers.Static) != 0 && syntax is OperatorDeclarationSyntax { OperatorToken: var opToken } && opToken.Kind() is not (SyntaxKind.EqualsEqualsToken or SyntaxKind.ExclamationEqualsToken)) 199if ((result & DeclarationModifiers.Abstract) != 0) 201result |= DeclarationModifiers.Sealed; 207static void reportModifierIfPresent(DeclarationModifiers result, DeclarationModifiers errorModifier, Location location, BindingDiagnosticBag diagnostics, CSharpRequiredLanguageVersion requiredVersionArgument, string availableVersionArgument)
Symbols\SymbolExtensions.cs (5)
291internal static void CheckUnsafeModifier(this Symbol symbol, DeclarationModifiers modifiers, BindingDiagnosticBag diagnostics) 296internal static void CheckUnsafeModifier(this Symbol symbol, DeclarationModifiers modifiers, Location errorLocation, BindingDiagnosticBag diagnostics) 299internal static void CheckUnsafeModifier(this Symbol symbol, DeclarationModifiers modifiers, Location errorLocation, DiagnosticBag? diagnostics) 302(modifiers & DeclarationModifiers.Unsafe) == DeclarationModifiers.Unsafe &&
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (4)
36private static (DeclarationModifiers, Flags) MakeModifiersAndFlags(SourceMemberContainerTypeSymbol containingType, TypeDeclarationSyntax syntax) 40DeclarationModifiers declarationModifiers = containingType.IsAbstract ? DeclarationModifiers.Protected : DeclarationModifiers.Public;
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (3)
20: base(containingType, WellKnownMemberNames.ObjectEquals, memberOffset, DeclarationModifiers.Public | DeclarationModifiers.Override | DeclarationModifiers.Sealed)
Symbols\Synthesized\Records\SynthesizedRecordClone.cs (18)
30private static DeclarationModifiers MakeDeclarationModifiers(SourceMemberContainerTypeSymbol containingType) 32DeclarationModifiers result = DeclarationModifiers.Public; 36result |= DeclarationModifiers.Override; 40result |= containingType.IsSealed ? DeclarationModifiers.None : DeclarationModifiers.Virtual; 45result &= ~DeclarationModifiers.Virtual; 46result |= DeclarationModifiers.Abstract; 55static bool modifiersAreValid(DeclarationModifiers modifiers) 57if ((modifiers & DeclarationModifiers.AccessibilityMask) != DeclarationModifiers.Public) 62modifiers &= ~DeclarationModifiers.AccessibilityMask; 66case DeclarationModifiers.None: 68case DeclarationModifiers.Abstract: 70case DeclarationModifiers.Override: 72case DeclarationModifiers.Abstract | DeclarationModifiers.Override: 74case DeclarationModifiers.Virtual:
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (2)
24DeclarationModifiers.Public | (IsReadOnly(containingType, positionalMembers) ? DeclarationModifiers.ReadOnly : 0))
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (6)
29(true, true) => DeclarationModifiers.Private, 30(false, true) => DeclarationModifiers.Protected | DeclarationModifiers.Virtual, 31(_, false) => DeclarationModifiers.Protected | DeclarationModifiers.Override 136DeclarationModifiers propertyModifiers,
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (2)
40DeclarationModifiers.Public | DeclarationModifiers.Static, hasAnyBody: true, isExpressionBodied: false, isIterator: false, isNullableAnalysisEnabled: false, diagnostics)
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (3)
23DeclarationModifiers.Public | 24(containingType.IsSealed ? 0 : DeclarationModifiers.Virtual) | 25(containingType.IsRecordStruct ? DeclarationModifiers.ReadOnly : 0))
Symbols\Synthesized\Records\SynthesizedRecordObjectMethod.cs (3)
16DeclarationModifiers.Public | DeclarationModifiers.Override | (isReadOnly ? DeclarationModifiers.ReadOnly : 0))
Symbols\Synthesized\Records\SynthesizedRecordOrdinaryMethod.cs (1)
23protected SynthesizedRecordOrdinaryMethod(SourceMemberContainerTypeSymbol containingType, string name, int memberOffset, DeclarationModifiers declarationModifiers)
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (18)
35private static DeclarationModifiers MakeDeclarationModifiers(SourceMemberContainerTypeSymbol containingType, IEnumerable<Symbol> userDefinedMembers) 37var result = (containingType.IsRecordStruct || (containingType.BaseTypeNoUseSiteDiagnostics.IsObjectType() && containingType.IsSealed)) ? 38DeclarationModifiers.Private : 39DeclarationModifiers.Protected; 43result |= DeclarationModifiers.Override; 47result |= containingType.IsSealed ? DeclarationModifiers.None : DeclarationModifiers.Virtual; 55result |= DeclarationModifiers.ReadOnly; 61bool modifiersAreValid(DeclarationModifiers modifiers) 65return modifiers == DeclarationModifiers.Private; 68if ((modifiers & DeclarationModifiers.AccessibilityMask) != DeclarationModifiers.Private && 69(modifiers & DeclarationModifiers.AccessibilityMask) != DeclarationModifiers.Protected) 74modifiers &= ~DeclarationModifiers.AccessibilityMask; 78case DeclarationModifiers.None: 79case DeclarationModifiers.Override: 80case DeclarationModifiers.Virtual:
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (3)
30modifiers: DeclarationModifiers.Public | (isOverride ? DeclarationModifiers.Override : DeclarationModifiers.None),
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (6)
24protected override DeclarationModifiers Modifiers { get; } 35Modifiers = DeclarationModifiers.Private | 36(isReadOnly ? DeclarationModifiers.ReadOnly : DeclarationModifiers.None) | 37(isStatic ? DeclarationModifiers.Static : DeclarationModifiers.None);
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (9)
22private readonly DeclarationModifiers _modifiers; 36_modifiers = (isPublic ? DeclarationModifiers.Public : DeclarationModifiers.Private) | 37(isReadOnly ? DeclarationModifiers.ReadOnly : DeclarationModifiers.None) | 38(isStatic ? DeclarationModifiers.Static : DeclarationModifiers.None); 107get { return (_modifiers & DeclarationModifiers.ReadOnly) != 0; } 178get { return (_modifiers & DeclarationModifiers.Static) != 0; }
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (6)
62private static (DeclarationModifiers, Flags) MakeModifiersAndFlags(SourceMemberContainerTypeSymbol containingType, SingleTypeDeclaration declaration) 67DeclarationModifiers declarationModifiers = DeclarationModifiers.Static | DeclarationModifiers.Private | (hasAwait ? DeclarationModifiers.Async : DeclarationModifiers.None);