212 references to BinderFlags
Microsoft.CodeAnalysis.CSharp (211)
Binder\Binder.cs (21)
25internal readonly BinderFlags Flags; 47protected Binder(Binder next, BinderFlags flags) 51RoslynDebug.Assert(!flags.Includes(BinderFlags.UncheckedRegion | BinderFlags.CheckedRegion)); 53RoslynDebug.Assert(!flags.Includes(BinderFlags.InNestedFinallyBlock) || flags.Includes(BinderFlags.InFinallyBlock | BinderFlags.InCatchBlock)); 63return this.Flags.Includes(BinderFlags.SemanticModel); 72return this.Flags.Includes(BinderFlags.EarlyAttributeBinding); 113RoslynDebug.Assert(!this.Flags.Includes(BinderFlags.UncheckedRegion | BinderFlags.CheckedRegion)); 115return this.Flags.Includes(BinderFlags.CheckedRegion) 117: this.Flags.Includes(BinderFlags.UncheckedRegion) 228internal bool InExpressionTree => (Flags & BinderFlags.InExpressionTree) == BinderFlags.InExpressionTree; 639BinderFlags location) 705BinderFlags location) 713internal static ObsoleteDiagnosticKind ReportDiagnosticsIfObsoleteInternal(DiagnosticBag diagnostics, Symbol symbol, SyntaxNodeOrToken node, Symbol? containingMember, BinderFlags location) 744internal static void ReportDiagnosticsIfObsoleteInternal(BindingDiagnosticBag diagnostics, Symbol symbol, SyntaxNodeOrToken node, Symbol containingMember, BinderFlags location) 785return this.Flags.Includes(BinderFlags.IgnoreAccessibility) || AccessCheck.IsSymbolAccessible(symbol, within, ref useSiteInfo, throughTypeOpt); 796if (this.Flags.Includes(BinderFlags.IgnoreAccessibility))
Binder\Binder.ValueChecks.cs (1)
1631return Flags.Includes(BinderFlags.ObjectInitializerMember) && receiver.Kind == BoundKind.ObjectOrCollectionValuePlaceholder ||
Binder\Binder_Attributes.cs (1)
158binder = binder.WithAdditionalFlags(BinderFlags.AttributeArgument);
Binder\Binder_Await.cs (7)
138return this.Flags.Includes(BinderFlags.InCatchFilter) || 139this.Flags.Includes(BinderFlags.InLockBody); 205if (this.InUnsafeRegion && !this.Flags.Includes(BinderFlags.AllowAwaitInUnsafeContext)) 210else if (this.Flags.Includes(BinderFlags.InLockBody)) 215else if (this.Flags.Includes(BinderFlags.InCatchFilter)) 220else if (this.Flags.Includes(BinderFlags.InFinallyBlock) && 226else if (this.Flags.Includes(BinderFlags.InCatchBlock) &&
Binder\Binder_Constraints.cs (1)
32Debug.Assert(this.Flags.Includes(BinderFlags.GenericConstraintsClause));
Binder\Binder_Crefs.cs (3)
83Debug.Assert(Flags.Includes(BinderFlags.Cref)); 961Binder parameterOrReturnTypeBinder = this.WithAdditionalFlags(BinderFlags.CrefParameterOrReturnType); 968(parameterOrReturnTypeBinder.Flags & ~BinderFlags.SemanticModel));
Binder\Binder_Expressions.cs (17)
66get { return this.Flags.Includes(BinderFlags.FieldInitializer); } 71get { return this.Flags.Includes(BinderFlags.ParameterDefaultValue); } 76get { return this.Flags.Includes(BinderFlags.ConstructorInitializer); } 81get { return this.Flags.Includes(BinderFlags.AttributeArgument); } 86get { return this.Flags.Includes(BinderFlags.Cref); } 91get { return InCref && !this.Flags.Includes(BinderFlags.CrefParameterOrReturnType); } 487var binder = new LocalScopeBinder(this.WithContainingMemberOrLambda(parameter.ContainingSymbol).WithAdditionalFlags(BinderFlags.ParameterDefaultValue)); 1458Debug.Assert((this.Flags & BinderFlags.InContextualAttributeBinder) != 0); 4536if (this.Flags.IncludesAny(BinderFlags.InCatchBlock | BinderFlags.InCatchFilter | BinderFlags.InFinallyBlock)) 5634? this.WithAdditionalFlags(BinderFlags.ObjectInitializerMember) 6217var collectionInitializerAddMethodBinder = this.WithAdditionalFlags(BinderFlags.CollectionInitializerAddMethod); 6416Debug.Assert(collectionInitializerAddMethodBinder.Flags.Includes(BinderFlags.CollectionInitializerAddMethod)); 8061(Flags.Includes(BinderFlags.CollectionExpressionConversionValidation | BinderFlags.CollectionInitializerAddMethod) && name is ParameterSyntax)) 8811ErrorCode errorCode = this.Flags.Includes(BinderFlags.ObjectInitializerMember) ?
Binder\Binder_Flags.cs (15)
28internal BinderWithContainingMemberOrLambda(Binder next, BinderFlags flags, Symbol containingMemberOrLambda) 64internal Binder WithFlags(BinderFlags flags) 71internal Binder WithAdditionalFlags(BinderFlags flags) 88internal Binder WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags flags, Symbol containing) 102if (this.Flags.Includes(BinderFlags.UnsafeRegion)) 105? new Binder(this, this.Flags & ~BinderFlags.UnsafeRegion) 110? new Binder(this, this.Flags | BinderFlags.UnsafeRegion) 116Debug.Assert(!this.Flags.Includes(BinderFlags.UncheckedRegion | BinderFlags.CheckedRegion)); 118BinderFlags added = @checked ? BinderFlags.CheckedRegion : BinderFlags.UncheckedRegion; 119BinderFlags removed = @checked ? BinderFlags.UncheckedRegion : BinderFlags.CheckedRegion;
Binder\Binder_Initializers.cs (3)
154return new LocalScopeBinder(binder).WithAdditionalFlagsAndContainingMemberOrLambda(suppressBinderFlagsFieldInitializer ? BinderFlags.None : BinderFlags.FieldInitializer, fieldSymbol); 223parentBinder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.FieldInitializer, fieldSymbol),
Binder\Binder_Invocation.cs (1)
1600if (Flags.Includes(BinderFlags.ParameterDefaultValue))
Binder\Binder_Lookup.cs (3)
1351&& (this.Flags & BinderFlags.InEEMethodBinder) == 0) 1688if (this.Flags.Includes(BinderFlags.IgnoreAccessibility)) 1699/// which will already have checked for <see cref="BinderFlags.IgnoreAccessibility"/>.
Binder\Binder_Operators.cs (1)
2543bool allowManagedAddressOf = Flags.Includes(BinderFlags.AllowMoveableAddressOf);
Binder\Binder_Statements.cs (7)
254if (this.Flags.Includes(BinderFlags.InFinallyBlock)) 258else if (this.Flags.Includes(BinderFlags.InTryBlockOfTryCatch)) 262else if (this.Flags.Includes(BinderFlags.InCatchBlock)) 281if (this.Flags.Includes(BinderFlags.InFinallyBlock)) 444else if (!this.Flags.Includes(BinderFlags.InCatchBlock)) 449else if (this.Flags.Includes(BinderFlags.InNestedFinallyBlock)) 3904Binder initializerBinder = outerBinder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.ConstructorInitializer, constructor);
Binder\Binder_Symbols.cs (6)
596if (!Flags.HasFlag(BinderFlags.SuppressConstraintChecks)) 1236else if ((Flags & BinderFlags.SuppressTypeArgumentBinding) != 0) 1359? this.WithAdditionalFlags(BinderFlags.SuppressUnsafeDiagnostics) 1579return !this.Flags.Includes(BinderFlags.SuppressConstraintChecks); 2073else if (this.Flags.Includes(BinderFlags.IgnoreCorLibraryDuplicatedTypes) && 2650if ((binder.Flags & BinderFlags.InContextualAttributeBinder) != 0)
Binder\Binder_Unsafe.cs (2)
23get { return this.Flags.Includes(BinderFlags.UnsafeRegion); } 55if (this.Flags.Includes(BinderFlags.SuppressUnsafeDiagnostics))
Binder\BinderFactory.BinderFactoryVisitor.cs (5)
1403BinderFlags flags = BinderFlags.Cref | BinderFlags.SuppressConstraintChecks | BinderFlags.UnsafeRegion; 1406flags |= BinderFlags.CrefParameterOrReturnType;
Binder\BinderFlagsExtensions.cs (5)
10/// Extension methods for the <see cref="BinderFlags"/> type. 14public static bool Includes(this BinderFlags self, BinderFlags other) 19public static bool IncludesAny(this BinderFlags self, BinderFlags other)
Binder\BlockBinder.cs (1)
26public BlockBinder(Binder enclosing, BlockSyntax block, BinderFlags additionalFlags)
Binder\CatchClauseBinder.cs (2)
21: base(enclosing, (enclosing.Flags | BinderFlags.InCatchBlock) & ~BinderFlags.InNestedFinallyBlock)
Binder\CollectionInitializerAddMethodBinder.cs (1)
18: base(next, next.Flags | BinderFlags.CollectionInitializerAddMethod)
Binder\ConstantFieldsInProgressBinder.cs (1)
19: base(next, BinderFlags.FieldInitializer | next.Flags)
Binder\ContextualAttributeBinder.cs (1)
26: base(enclosing, enclosing.Flags | BinderFlags.InContextualAttributeBinder)
Binder\EarlyWellKnownAttributeBinder.cs (1)
22: base(enclosing, enclosing.Flags | BinderFlags.EarlyAttributeBinding)
Binder\ExecutableCodeBinder.cs (2)
38internal ExecutableCodeBinder(SyntaxNode root, Symbol memberSymbol, Binder next, BinderFlags additionalFlags) 39: base(next, (next.Flags | additionalFlags) & ~BinderFlags.AllClearedAtExecutableCodeBoundary)
Binder\ForEachEnumeratorInfo.cs (3)
49public readonly BinderFlags Location; 65BinderFlags location) 116public ForEachEnumeratorInfo Build(BinderFlags location)
Binder\InMethodBinder.cs (3)
41: base(enclosing, enclosing.Flags & ~BinderFlags.AllClearedAtExecutableCodeBoundary) 43Debug.Assert(!enclosing.Flags.Includes(BinderFlags.InCatchFilter)); 210if ((this.Flags & BinderFlags.InEEMethodBinder) != 0 && parameter.Type.IsDisplayClassType())
Binder\LocalBinderFactory.cs (13)
184Binder enclosing = new ExpressionVariableBinder(node, _enclosing).WithAdditionalFlags(BinderFlags.ConstructorInitializer); 222if ((_enclosing.Flags & BinderFlags.InContextualAttributeBinder) != 0) 289Debug.Assert((current.Flags & BinderFlags.InContextualAttributeBinder) != 0); 496var binder = _enclosing.WithAdditionalFlags(BinderFlags.ConstructorInitializer); 688Binder binder = _enclosing.WithAdditionalFlags(BinderFlags.UnsafeRegion); 721Binder statementBinder = lockBinder.WithAdditionalFlags(BinderFlags.InLockBody); 860Visit(node.Block, _enclosing.WithAdditionalFlags(BinderFlags.InTryBlockOfTryCatch)); 886Binder filterBinder = clauseBinder.WithAdditionalFlags(BinderFlags.InCatchFilter); 911var additionalFlags = BinderFlags.InFinallyBlock; 912if (_enclosing.Flags.Includes(BinderFlags.InCatchBlock)) 914additionalFlags |= BinderFlags.InNestedFinallyBlock; 920Debug.Assert(_map.TryGetValue(node.Block, out finallyBinder) && finallyBinder.Flags.Includes(BinderFlags.InFinallyBlock));
Binder\LocalScopeBinder.cs (1)
30internal LocalScopeBinder(Binder next, BinderFlags flags)
Binder\ParamsCollectionTypeInProgressBinder.cs (1)
20: base(next, next.Flags | BinderFlags.CollectionExpressionConversionValidation)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (2)
677if (_binder.InAttributeArgument || (_binder.Flags & BinderFlags.InContextualAttributeBinder) != 0) 1315if (binder.Flags.HasFlag(BinderFlags.AttributeArgument) && !type.IsSZArray())
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (5)
508if ((binder.Flags & BinderFlags.CollectionExpressionConversionValidation) != 0) 664else if (binder.Flags.Includes(BinderFlags.CollectionInitializerAddMethod)) 1087BinderFlags flags, 1111if (flags.Includes(BinderFlags.CollectionInitializerAddMethod)) 1130if (flags.Includes(BinderFlags.CollectionExpressionConversionValidation))
Binder\TypeofBinder.cs (1)
29: base(next, next.Flags | BinderFlags.UnsafeRegion)
BoundTree\UnboundLambda.cs (2)
812lambdaBodyBinder = new ExecutableCodeBinder(_unboundLambda.Syntax, lambdaSymbol, GetWithParametersBinder(lambdaSymbol, Binder), inExpressionTree ? BinderFlags.InExpressionTree : BinderFlags.None);
Compilation\CSharpSemanticModel.cs (7)
259if (bindingOption == SpeculativeBindingOption.BindAsTypeOrNamespace || binder.Flags.Includes(BinderFlags.CrefParameterOrReturnType)) 296if (binder.Flags.Includes(BinderFlags.CrefParameterOrReturnType)) 3253internal BinderFlags GetSemanticModelBinderFlags() 3256? BinderFlags.SemanticModel | BinderFlags.IgnoreAccessibility 3257: BinderFlags.SemanticModel; 4618binder = binder.WithAdditionalFlags(BinderFlags.SemanticModel);
Compilation\MemberSemanticModel.cs (3)
1763/// Returned binder doesn't need to have <see cref="BinderFlags.SemanticModel"/> set - the caller will add it. 1895/// Returned binder doesn't need to have <see cref="BinderFlags.SemanticModel"/> set - the caller will add it. 2412return new IncrementalBinder(_semanticModel, binder.WithAdditionalFlags(BinderFlags.SemanticModel));
Compilation\PublicSemanticModel.cs (1)
31enclosingBinder.WithAdditionalFlags(BinderFlags.AttributeArgument),
Compilation\SyntaxTreeSemanticModel.cs (2)
1072Binder defaultOuter() => _binderFactory.GetBinder(node).WithAdditionalFlags(this.IgnoresAccessibility ? BinderFlags.IgnoreAccessibility : BinderFlags.None);
CSharpCompilationOptions.cs (5)
39internal BinderFlags TopLevelBinderFlags { get; private set; } 92topLevelBinderFlags: BinderFlags.None, 216BinderFlags topLevelBinderFlags, 269internal CSharpCompilationOptions WithTopLevelBinderFlags(BinderFlags flags) 938topLevelBinderFlags: BinderFlags.None,
Errors\LazyObsoleteDiagnosticInfo.cs (2)
16private readonly BinderFlags _binderFlags; 18internal LazyObsoleteDiagnosticInfo(object symbol, Symbol containingSymbol, BinderFlags binderFlags)
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
278Binder.ReportDiagnosticsIfObsolete(_diagnostics, node.EventSymbol.AssociatedField, node.Syntax, hasBaseReceiver, _containingSymbol, _containingSymbol.ContainingType, BinderFlags.None); 292Binder.ReportDiagnosticsIfObsolete(_diagnostics, node.Event, ((AssignmentExpressionSyntax)node.Syntax).Left, hasBaseReceiver, _containingSymbol, _containingSymbol.ContainingType, BinderFlags.None);
Symbols\AliasSymbol.cs (5)
385var flags = BinderFlags.SuppressConstraintChecks | BinderFlags.SuppressObsoleteChecks; 389flags |= BinderFlags.UnsafeRegion; 397flags |= BinderFlags.UnsafeRegion;
Symbols\Compilation_WellKnownMembers.cs (1)
125bool ignoreCorLibraryDuplicatedTypes = this.Options.TopLevelBinderFlags.Includes(BinderFlags.IgnoreCorLibraryDuplicatedTypes);
Symbols\ConstraintsHelper.cs (7)
359Debug.Assert(!withTypeParametersBinder.Flags.Includes(BinderFlags.GenericConstraintsClause)); 360withTypeParametersBinder = withTypeParametersBinder.WithAdditionalFlags(BinderFlags.GenericConstraintsClause | BinderFlags.SuppressConstraintChecks); 397Debug.Assert(!withTypeParametersBinder.Flags.Includes(BinderFlags.GenericConstraintsClause)); 398withTypeParametersBinder = withTypeParametersBinder.WithAdditionalFlags(BinderFlags.GenericConstraintsClause | BinderFlags.SuppressConstraintChecks | BinderFlags.SuppressTypeArgumentBinding);
Symbols\ObsoleteAttributeHelpers.cs (4)
152internal static DiagnosticInfo CreateObsoleteDiagnostic(Symbol symbol, BinderFlags location) 158static DiagnosticInfo createObsoleteDiagnostic(Symbol symbol, BinderFlags location) 173if (location.Includes(BinderFlags.SuppressObsoleteChecks)) 198var isColInit = location.Includes(BinderFlags.CollectionInitializerAddMethod);
Symbols\Source\ExplicitInterfaceHelpers.cs (2)
51binder = binder.WithAdditionalFlags(BinderFlags.SuppressConstraintChecks | BinderFlags.SuppressObsoleteChecks);
Symbols\Source\GlobalExpressionVariable.cs (1)
190binder = binder.WithContainingMemberOrLambda(_containingFieldOpt).WithAdditionalFlags(BinderFlags.FieldInitializer);
Symbols\Source\SourceConstructorSymbolBase.cs (1)
49var signatureBinder = bodyBinder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.SuppressConstraintChecks, this);
Symbols\Source\SourceEventSymbol.cs (2)
743binder = binder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.SuppressConstraintChecks | BinderFlags.SuppressUnsafeDiagnostics, this);
Symbols\Source\SourceMemberFieldSymbol.cs (1)
485binder = binder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.SuppressConstraintChecks, this);
Symbols\Source\SourceMemberMethodSymbol.cs (2)
769return inMethod == null ? null : new ExecutableCodeBinder(SyntaxNode, this, inMethod.WithAdditionalFlags(ignoreAccessibility ? BinderFlags.IgnoreAccessibility : BinderFlags.None));
Symbols\Source\SourceNamedTypeSymbol.cs (8)
51baseBinder = baseBinder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.SuppressConstraintChecks, this); 350Debug.Assert(!binder.Flags.Includes(BinderFlags.GenericConstraintsClause)); 351binder = binder.WithContainingMemberOrLambda(this).WithAdditionalFlags(BinderFlags.GenericConstraintsClause | BinderFlags.SuppressConstraintChecks); 431Debug.Assert(!binder.Flags.Includes(BinderFlags.GenericConstraintsClause)); 432binder = binder.WithContainingMemberOrLambda(this).WithAdditionalFlags(BinderFlags.GenericConstraintsClause | BinderFlags.SuppressConstraintChecks | BinderFlags.SuppressTypeArgumentBinding);
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (2)
221baseBinder = baseBinder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.SuppressConstraintChecks, this); 453baseBinder = baseBinder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.SuppressConstraintChecks, this);
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (4)
735var flags = BinderFlags.SuppressConstraintChecks; 749flags |= BinderFlags.UnsafeRegion; 758flags |= BinderFlags.UnsafeRegion;
Symbols\Source\SourceOrdinaryMethodSymbol.cs (3)
123var signatureBinder = withTypeParamsBinder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.SuppressConstraintChecks, this); 169declaredConstraints = signatureBinder.WithAdditionalFlags(BinderFlags.GenericConstraintsClause | BinderFlags.SuppressConstraintChecks).
Symbols\Source\SourcePropertySymbol.cs (1)
550return binder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.SuppressConstraintChecks, this);
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
229var signatureBinder = binder.WithAdditionalFlags(BinderFlags.SuppressConstraintChecks);
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (2)
108return new ExecutableCodeBinder(SyntaxNode, this, result.WithAdditionalFlags(ignoreAccessibility ? BinderFlags.IgnoreAccessibility : BinderFlags.None));
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (2)
229result = result.WithAdditionalFlags(ignoreAccessibility ? BinderFlags.IgnoreAccessibility : BinderFlags.None);
Symbols\Tuples\TupleTypeSymbol.cs (1)
255Binder.ReportDiagnosticsIfObsoleteInternal(diagnostics, firstTupleType, syntax, firstTupleType.ContainingType, BinderFlags.None);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\CSharpCompilationOptionsTests.cs (1)
413var topLevelBinderFlags = BinderFlags.None;