Binder\Binder.IdentifierUsedAsValueFinder.cs (34)
26protected bool CheckIdentifiersInNode(CSharpSyntaxNode? node, Binder binder)
37Binder enclosingBinder = getEnclosingBinderForNode(contextNode: node, contextBinder: binder, n);
107static Binder getEnclosingBinderForNode(CSharpSyntaxNode contextNode, Binder contextBinder, SyntaxNode targetNode)
111Binder? enclosingBinder = contextBinder.GetBinder(targetNode);
171private bool CheckLambda(AnonymousFunctionExpressionSyntax lambdaSyntax, Binder enclosingBinder)
178private static ExecutableCodeBinder CreateLambdaBodyBinder(Binder enclosingBinder, UnboundLambda unboundLambda)
194private bool CheckIdentifier(Binder enclosingBinder, IdentifierNameSyntax id)
205protected abstract bool CheckAndClearLookupResult(Binder enclosingBinder, IdentifierNameSyntax id, LookupResult lookupResult);
208Binder enclosingBinder,
248/// Follows the logic of <see cref="Binder.BindInstanceMemberAccess"/> and <see cref="Binder.BindMemberOfType"/>
251Binder enclosingBinder,
307/// Follows the logic of <see cref="Binder.BindQuery"/>
309private bool CheckQuery(QueryExpressionSyntax query, Binder enclosingBinder)
335/// Follows the logic of <see cref="Binder.BindQueryInternal2"/>
337private bool BindQueryInternal(Binder enclosingBinder, QueryTranslationState state)
353/// Follows the logic of <see cref="Binder.FinalTranslation"/>
355private bool FinalTranslation(Binder enclosingBinder, QueryTranslationState state)
396/// Follows the logic of <see cref="Binder.ReduceQuery"/>
398private bool ReduceQuery(Binder enclosingBinder, QueryTranslationState state)
419/// Follows the logic of <see cref="Binder.ReduceWhere"/>
421private bool ReduceWhere(Binder enclosingBinder, WhereClauseSyntax where, QueryTranslationState state)
433/// Follows the logic of <see cref="Binder.ReduceJoin"/>
435private bool ReduceJoin(Binder enclosingBinder, JoinClauseSyntax join, QueryTranslationState state)
460/// Follows the logic of <see cref="Binder.ReduceOrderBy"/>
462private bool ReduceOrderBy(Binder enclosingBinder, OrderByClauseSyntax orderby, QueryTranslationState state)
489/// Follows the logic of <see cref="Binder.ReduceFrom"/>
491private bool ReduceFrom(Binder enclosingBinder, FromClauseSyntax from, QueryTranslationState state)
504/// Follows the logic of <see cref="Binder.ReduceLet"/>
506private bool ReduceLet(Binder enclosingBinder, LetClauseSyntax let, QueryTranslationState state)
529private bool MakeQueryUnboundLambda(Binder enclosingBinder, RangeVariableMap qvm, RangeVariableSymbol parameter, ExpressionSyntax expression)
531UnboundLambda unboundLambda = Binder.MakeQueryUnboundLambda(
535(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics) => throw ExceptionUtilities.Unreachable()),
Binder\Binder.QueryUnboundLambdaState.cs (6)
17private delegate BoundBlock LambdaBodyFactory(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics);
25public QueryUnboundLambdaState(Binder binder, RangeVariableMap rangeVariableMap, ImmutableArray<RangeVariableSymbol> parameters, LambdaBodyFactory bodyFactory, bool includeCache = true)
63public override Binder GetWithParametersBinder(LambdaSymbol lambdaSymbol, Binder binder)
78protected override BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics)
83protected override BoundBlock BindLambdaBodyCore(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics)
Binder\Binder.WithQueryLambdaParametersBinder.cs (3)
26public WithQueryLambdaParametersBinder(LambdaSymbol lambdaSymbol, RangeVariableMap rangeVariableMap, Binder next)
105LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
120internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
Binder\Binder_Attributes.cs (12)
30ImmutableArray<Binder> binders, ImmutableArray<AttributeSyntax> attributesToBind, Symbol ownerSymbol, NamedTypeSymbol[] boundAttributeTypes,
46var binder = binders[i];
72ImmutableArray<Binder> binders,
92Binder binder = binders[i];
143private Binder SkipSemanticModelBinder()
145Binder result = this;
155private static BoundAttribute BindAttributeCore(Binder binder, AttributeSyntax node, NamedTypeSymbol attributeType, Symbol? attributedMember, BindingDiagnosticBag diagnostics)
754private readonly Binder _binder;
756public AttributeExpressionVisitor(Binder binder)
891Binder.Error(diagnostics, ErrorCode.ERR_BadAttributeArgument, node.Syntax);
962Binder.Error(diagnostics, ErrorCode.ERR_AttrArgWithTypeVars, node.Syntax, typeOfArgument.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
1046Binder.Error(diagnostics, ErrorCode.ERR_BadAttributeArgument, node.Syntax);
Binder\Binder_Expressions.cs (19)
448Binder initializerBinder = this.GetBinder(initializerOpt);
483internal Binder CreateBinderForParameterDefaultValue(
503Binder defaultValueBinder = this.GetBinder(defaultValueSyntax);
521Binder initializerBinder = this.GetBinder(equalsValueSyntax);
1701Binder current = this;
1753Binder binder = this;
1761if (binder is { Next: Binder withPrimaryConstructorParametersBinder })
4724Binder argumentListBinder = null;
5209static BoundNode bindElement(CollectionElementSyntax syntax, BindingDiagnosticBag diagnostics, Binder @this, int nestingLevel)
5220static BoundNode bindSpreadElement(SpreadElementSyntax syntax, BindingDiagnosticBag diagnostics, Binder @this)
5633var objectInitializerMemberBinder = useObjectInitDiagnostics
5660Binder objectInitializerMemberBinder,
6217var collectionInitializerAddMethodBinder = this.WithAdditionalFlags(BinderFlags.CollectionInitializerAddMethod);
6276Binder collectionInitializerAddMethodBinder,
6321Binder collectionInitializerAddMethodBinder = null,
6360Binder collectionInitializerAddMethodBinder,
6411Binder collectionInitializerAddMethodBinder,
6513Binder collectionInitializerAddMethodBinder,
7357var binder = this.GetBinder(node);
Binder\Binder_Lookup.cs (39)
61private Binder LookupSymbolsWithFallback(LookupResult result, string name, int arity, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved = null, LookupOptions options = LookupOptions.Default)
66var binder = this.LookupSymbolsInternal(result, name, arity, basesBeingResolved, options, diagnose: false, useSiteInfo: ref useSiteInfo);
73var otherBinder = this.LookupSymbolsInternal(result, name, arity, basesBeingResolved, options, diagnose: true, useSiteInfo: ref useSiteInfo);
81private Binder LookupSymbolsInternal(
87Binder binder = null;
88for (var scope = this; scope != null && !result.IsMultiViable; scope = scope.Next)
116LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
164protected void LookupMembersInternal(LookupResult result, NamespaceOrTypeSymbol nsOrType, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
180protected void LookupMembersInType(LookupResult result, TypeSymbol type, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
220private void LookupMembersInErrorType(LookupResult result, ErrorTypeSymbol errorType, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
256LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
400Binder originalBinder,
443private static void LookupMembersInNamespace(LookupResult result, NamespaceSymbol ns, string name, int arity, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
463var binder = scope.Binder;
758Binder originalBinder)
764LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved)
785Binder originalBinder,
800Binder originalBinder,
879Binder originalBinder,
1019Binder originalBinder,
1122Binder originalBinder,
1150private void LookupMembersInInterface(LookupResult current, NamedTypeSymbol type, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1168private void LookupMembersInTypeParameter(LookupResult current, TypeParameterSymbol typeParameter, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1293internal static ImmutableArray<Symbol> GetCandidateMembers(NamespaceOrTypeSymbol nsOrType, string name, LookupOptions options, Binder originalBinder)
1317internal static ImmutableArray<Symbol> GetCandidateMembers(NamespaceOrTypeSymbol nsOrType, LookupOptions options, Binder originalBinder)
1369for (var binder = this; binder != null; binder = binder.Next)
1831for (var scope = this; scope != null; scope = scope.Next)
1843internal virtual void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo info, LookupOptions options, Binder originalBinder)
1851internal void AddMemberLookupSymbolsInfo(LookupSymbolsInfo result, NamespaceOrTypeSymbol nsOrType, LookupOptions options, Binder originalBinder)
1863private void AddMemberLookupSymbolsInfoInType(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder)
1887protected void AddMemberLookupSymbolsInfoInSubmissions(LookupSymbolsInfo result, TypeSymbol scriptClass, bool inUsings, LookupOptions options, Binder originalBinder)
1919LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
1938static void addAliasSymbolToResult(LookupSymbolsInfo result, AliasSymbol aliasSymbol, LookupOptions options, Binder originalBinder)
1948private static void AddMemberLookupSymbolsInfoInNamespace(LookupSymbolsInfo result, NamespaceSymbol ns, LookupOptions options, Binder originalBinder)
1960private static void AddMemberLookupSymbolsInfoWithoutInheritance(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
1972private void AddWinRTMembersLookupSymbolsInfo(LookupSymbolsInfo result, NamedTypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
1987private void AddMemberLookupSymbolsInfoInClass(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
2018private void AddMemberLookupSymbolsInfoInInterface(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
2033private void AddMemberLookupSymbolsInfoInTypeParameter(LookupSymbolsInfo result, TypeParameterSymbol type, LookupOptions options, Binder originalBinder)
Binder\Binder_Query.cs (4)
691LambdaBodyFactory bodyFactory = (LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag d) =>
725LambdaBodyFactory bodyFactory = (LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag d) =>
833return MakeQueryUnboundLambda(expression, new QueryUnboundLambdaState(this, qvm, parameters, (LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics) =>
844return MakeQueryUnboundLambda(expression, new QueryUnboundLambdaState(this, qvm, ImmutableArray.Create(parameter), (LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics) =>
Binder\Binder_Statements.cs (37)
172var unsafeBinder = this.GetBinder(node);
188var fixedBinder = this.GetBinder(node);
297var lockBinder = this.GetBinder(node);
302internal virtual BoundStatement BindLockStatementParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
309var usingBinder = this.GetBinder(node);
314internal virtual BoundStatement BindUsingStatementParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
321Binder binder;
476var binder = this.LookupSymbolsWithFallback(result, node.Identifier.ValueText, arity: 0, useSiteInfo: ref useSiteInfo, options: LookupOptions.LabelsOnly);
1870var binder = GetBinder(node);
2534static BoundStatement bindIfStatement(Binder binder, IfStatementSyntax node, BindingDiagnosticBag diagnostics)
2536var stack = ArrayBuilder<(Binder, IfStatementSyntax IfStatementSyntax, BoundExpression Condition, BoundStatement Consequence)>.GetInstance();
2554var b = binder.GetBinder(ifStatementSyntax);
2738Binder switchBinder = this.GetBinder(node);
2742internal virtual BoundStatement BindSwitchStatementCore(SwitchStatementSyntax node, Binder originalBinder, BindingDiagnosticBag diagnostics)
2756var loopBinder = this.GetBinder(node);
2761internal virtual BoundWhileStatement BindWhileParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
2768var loopBinder = this.GetBinder(node);
2774internal virtual BoundDoStatement BindDoParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
2781var loopBinder = this.GetBinder(node);
2786internal virtual BoundForStatement BindForParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
2879Binder loopBinder = this.GetBinder(node);
2883internal virtual BoundStatement BindForEachParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
2891internal virtual BoundStatement BindForEachDeconstruction(BindingDiagnosticBag diagnostics, Binder originalBinder)
2918private static SwitchBinder GetSwitchBinder(Binder binder)
3225var catchBinder = this.GetBinder(catchSyntax);
3274var filterBinder = this.GetBinder(filter);
3324var binder = GetBinder(node);
3562Binder bodyBinder = this.GetBinder(expressionBody);
3568static BoundBlock bindExpressionBodyAsBlockInternal(ArrowExpressionClauseSyntax expressionBody, Binder bodyBinder, BindingDiagnosticBag diagnostics)
3583Binder bodyBinder = this.GetBinder(body);
3595Binder bodyBinder = this.GetBinder(body);
3683Binder initializerBinder = GetBinder(baseWithArguments);
3717Binder bodyBinder = this.GetBinder(constructor);
3860Binder outerBinder;
3904Binder initializerBinder = outerBinder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.ConstructorInitializer, constructor);
3932if (Binder.ReportUseSite(baseConstructor, diagnostics, diagnosticsLocation))
3988if (Binder.ReportConstructorUseSiteDiagnostics(diagnosticsLocation, diagnostics, suppressUnsupportedRequiredMembersError: constructor.HasSetsRequiredMembers, constructorUseSiteInfo))
Binder\BinderFactory.BinderFactoryVisitor.cs (83)
20internal sealed class BinderFactoryVisitor : CSharpSyntaxVisitor<Binder>
69private ConcurrentCache<BinderCacheKey, Binder> binderCache
85public override Binder DefaultVisit(SyntaxNode parent)
92public override Binder Visit(SyntaxNode node)
98private Binder VisitCore(SyntaxNode node)
103public override Binder VisitGlobalStatement(GlobalStatementSyntax node)
116Binder result;
135public override Binder VisitMethodDeclaration(MethodDeclarationSyntax methodDecl)
160Binder resultBinder;
196public override Binder VisitConstructorDeclaration(ConstructorDeclarationSyntax parent)
208Binder resultBinder;
235public override Binder VisitDestructorDeclaration(DestructorDeclarationSyntax parent)
245Binder resultBinder;
262public override Binder VisitAccessorDeclaration(AccessorDeclarationSyntax parent)
274Binder resultBinder;
330private Binder VisitOperatorOrConversionDeclaration(BaseMethodDeclarationSyntax parent)
342Binder resultBinder;
363public override Binder VisitOperatorDeclaration(OperatorDeclarationSyntax parent)
368public override Binder VisitConversionOperatorDeclaration(ConversionOperatorDeclarationSyntax parent)
373public override Binder VisitFieldDeclaration(FieldDeclarationSyntax parent)
378public override Binder VisitEventDeclaration(EventDeclarationSyntax parent)
383public override Binder VisitEventFieldDeclaration(EventFieldDeclarationSyntax parent)
388public override Binder VisitPropertyDeclaration(PropertyDeclarationSyntax parent)
398public override Binder VisitIndexerDeclaration(IndexerDeclarationSyntax parent)
408private Binder VisitPropertyOrIndexerExpressionBody(BasePropertyDeclarationSyntax parent)
412Binder resultBinder;
434private NamedTypeSymbol GetContainerType(Binder binder, CSharpSyntaxNode node)
459private static string GetMethodName(BaseMethodDeclarationSyntax baseMethodDeclarationSyntax, Binder outerBinder)
486private static string GetPropertyOrEventName(BasePropertyDeclarationSyntax basePropertyDeclarationSyntax, Binder outerBinder)
507private SourceMemberMethodSymbol GetMethodSymbol(BaseMethodDeclarationSyntax baseMethodDeclarationSyntax, Binder outerBinder)
524private SourcePropertySymbol GetPropertySymbol(BasePropertyDeclarationSyntax basePropertyDeclarationSyntax, Binder outerBinder)
543private SourceEventSymbol GetEventSymbol(EventDeclarationSyntax eventDeclarationSyntax, Binder outerBinder)
662public override Binder VisitDelegateDeclaration(DelegateDeclarationSyntax parent)
671Binder resultBinder;
674Binder outer = VisitCore(parent.Parent); // a binder for the body of the enclosing type or namespace
694public override Binder VisitEnumDeclaration(EnumDeclarationSyntax parent)
706Binder resultBinder;
709Binder outer = VisitCore(parent.Parent); // a binder for the body of the type enclosing this type
725private Binder VisitTypeDeclarationCore(TypeDeclarationSyntax parent)
758internal Binder VisitTypeDeclarationCore(TypeDeclarationSyntax parent, NodeUsage extraInfo)
762Binder resultBinder;
804public override Binder VisitClassDeclaration(ClassDeclarationSyntax node)
809public override Binder VisitStructDeclaration(StructDeclarationSyntax node)
814public override Binder VisitInterfaceDeclaration(InterfaceDeclarationSyntax node)
819public override Binder VisitRecordDeclaration(RecordDeclarationSyntax node)
822public sealed override Binder VisitNamespaceDeclaration(NamespaceDeclarationSyntax parent)
838public override Binder VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax parent)
853internal Binder VisitNamespaceDeclaration(BaseNamespaceDeclarationSyntax parent, int position, bool inBody, bool inUsing)
860Binder result;
863Binder outer;
895private static Binder MakeNamespaceBinder(CSharpSyntaxNode node, NameSyntax name, Binder outer, bool inUsing)
931public override Binder VisitCompilationUnit(CompilationUnitSyntax parent)
939internal Binder VisitCompilationUnit(CompilationUnitSyntax compilationUnit, bool inUsing, bool inScript)
951Binder result;
1034private static Binder AddInImportsBinders(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, Binder next, bool inUsing)
1101public override Binder VisitDocumentationCommentTrivia(DocumentationCommentTriviaSyntax parent)
1110public override Binder VisitCrefParameter(CrefParameterSyntax parent)
1119public override Binder VisitConversionOperatorMemberCref(ConversionOperatorMemberCrefSyntax parent)
1130public override Binder VisitXmlCrefAttribute(XmlCrefAttributeSyntax parent)
1141private Binder VisitXmlCrefAttributeInternal(XmlCrefAttributeSyntax parent, NodeUsage extraInfo)
1148Binder result;
1166public override Binder VisitXmlNameAttribute(XmlNameAttributeSyntax parent)
1197Binder result;
1202Binder outerBinder = VisitCore(GetEnclosingDocumentationComment(parent));
1238private Binder GetParameterNameAttributeValueBinder(MemberDeclarationSyntax memberSyntax, Binder nextBinder)
1242Binder outerBinder = VisitCore(memberSyntax.Parent);
1250Binder outerBinder = VisitCore(memberSyntax);
1265Binder outerBinder = VisitCore(memberSyntax.Parent);
1287Binder outerBinder = VisitCore(memberSyntax.Parent);
1306private Binder GetTypeParameterNameAttributeValueBinder(MemberDeclarationSyntax memberSyntax, bool includeContainingSymbols, Binder nextBinder)
1310Binder outerBinder = VisitCore(memberSyntax.Parent);
1324Binder outerBinder = VisitCore(memberSyntax.Parent);
1336Binder outerBinder = VisitCore(memberSyntax.Parent);
1343Binder outerBinder = VisitCore(memberSyntax.Parent);
1371internal static Binder MakeCrefBinder(CrefSyntax crefSyntax, MemberDeclarationSyntax memberSyntax, BinderFactory factory, bool inParameterOrReturnType = false)
1376Binder binder = memberSyntax is BaseTypeDeclarationSyntax typeDeclSyntax
1382Binder getBinder(BaseTypeDeclarationSyntax baseTypeDeclaration)
1396private static Binder MakeCrefBinderInternal(CrefSyntax crefSyntax, Binder binder, bool inParameterOrReturnType)
Binder\BinderFactory.cs (11)
49private readonly ConcurrentCache<BinderCacheKey, Binder> _binderCache;
77_binderCache = new ConcurrentCache<BinderCacheKey, Binder>(50);
109internal Binder GetBinder(SyntaxNode node, CSharpSyntaxNode memberDeclarationOpt = null, Symbol memberOpt = null)
124internal Binder GetBinder(SyntaxNode node, int position, CSharpSyntaxNode memberDeclarationOpt = null, Symbol memberOpt = null)
135Binder result = visitor.Visit(node);
163if (!_binderCache.TryGetValue(key, out Binder resultBinder))
175internal Binder GetInTypeBodyBinder(TypeDeclarationSyntax typeDecl)
178Binder resultBinder = visitor.VisitTypeDeclarationCore(typeDecl, NodeUsage.NamedTypeBodyOrTypeParameters);
184internal Binder GetInNamespaceBinder(CSharpSyntaxNode unit)
192Binder result = visitor.VisitNamespaceDeclaration((BaseNamespaceDeclarationSyntax)unit, unit.SpanStart, inBody: true, inUsing: false);
201Binder result = visitor.VisitCompilationUnit((CompilationUnitSyntax)unit, inUsing: false, inScript: InScript);
Binder\BuckStopsHereBinder.cs (10)
171internal override Binder? GetBinder(SyntaxNode node)
186internal override BoundStatement BindSwitchStatementCore(SwitchStatementSyntax node, Binder originalBinder, BindingDiagnosticBag diagnostics)
192internal override BoundExpression BindSwitchExpressionCore(SwitchExpressionSyntax node, Binder originalBinder, BindingDiagnosticBag diagnostics)
210internal override BoundForStatement BindForParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
216internal override BoundStatement BindForEachParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
222internal override BoundStatement BindForEachDeconstruction(BindingDiagnosticBag diagnostics, Binder originalBinder)
228internal override BoundWhileStatement BindWhileParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
234internal override BoundDoStatement BindDoParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
240internal override BoundStatement BindUsingStatementParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
246internal override BoundStatement BindLockStatementParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
Binder\ExecutableCodeBinder.cs (10)
29private readonly Action<Binder, SyntaxNode> _binderUpdatedHandler;
30private SmallDictionary<SyntaxNode, Binder> _lazyBinderMap;
32internal ExecutableCodeBinder(SyntaxNode root, Symbol memberSymbol, Binder next, Action<Binder, SyntaxNode> binderUpdatedHandler = null)
38internal ExecutableCodeBinder(SyntaxNode root, Symbol memberSymbol, Binder next, BinderFlags additionalFlags)
58internal override Binder GetBinder(SyntaxNode node)
60Binder binder;
66SmallDictionary<SyntaxNode, Binder> map;
83map = SmallDictionary<SyntaxNode, Binder>.Empty;
90private SmallDictionary<SyntaxNode, Binder> BinderMap
Binder\InContainerBinder.cs (4)
28internal InContainerBinder(NamespaceOrTypeSymbol container, Binder next)
80Binder originalBinder)
104LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
131internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
Binder\InMethodBinder.cs (4)
31/// and <see cref="Binder.BindIdentifier"/> to validate some assumptions around identifiers.
40public InMethodBinder(MethodSymbol owner, Binder enclosing)
194LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
228internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
Binder\InSubmissionClassBinder.cs (4)
26internal InSubmissionClassBinder(NamedTypeSymbol submissionClass, Binder next, CompilationUnitSyntax declarationSyntax, bool inUsings)
39Binder originalBinder)
48LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
55internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
Binder\LocalBinderFactory.cs (40)
35private readonly SmallDictionary<SyntaxNode, Binder> _map;
37private Binder _enclosing;
40private void Visit(CSharpSyntaxNode syntax, Binder enclosing)
48Binder oldEnclosing = _enclosing;
55private void VisitRankSpecifiers(TypeSyntax type, Binder enclosing)
72public static SmallDictionary<SyntaxNode, Binder> BuildMap(
75Binder enclosing,
76Action<Binder, SyntaxNode> binderUpdatedHandler = null)
135private LocalBinderFactory(Symbol containingMemberOrLambda, SyntaxNode root, Binder enclosing)
140_map = new SmallDictionary<SyntaxNode, Binder>(ReferenceEqualityComparer.Instance);
156Binder enclosing = new ExpressionVariableBinder(node, _enclosing);
184Binder enclosing = new ExpressionVariableBinder(node, _enclosing).WithAdditionalFlags(BinderFlags.ConstructorInitializer);
218var oldEnclosing = _enclosing;
221Binder? withParametersBinder;
287static Symbol getAttributeTarget(Binder current)
290var contextualAttributeBinder = Binder.TryGetContextualAttributeBinder(current);
296static WithTypeParametersBinder? getExtraWithTypeParametersBinder(Binder enclosing, Symbol target)
301static Binder? getExtraWithParametersBinder(Binder enclosing, Symbol target)
408Binder binder = _enclosing;
440private static LocalFunctionSymbol FindLocalFunction(LocalFunctionStatementSyntax node, Binder enclosing)
446Binder possibleScopeBinder = enclosing;
496var binder = _enclosing.WithAdditionalFlags(BinderFlags.ConstructorInitializer);
501private void VisitConstructorInitializerArgumentList(CSharpSyntaxNode node, ArgumentListSyntax argumentList, Binder binder)
598Binder binder = new ForLoopBinder(_enclosing, node);
673Binder binder = _enclosing.WithCheckedOrUncheckedRegion(@checked: node.Kind() == SyntaxKind.CheckedExpression);
680Binder binder = _enclosing.WithCheckedOrUncheckedRegion(@checked: node.Kind() == SyntaxKind.CheckedStatement);
688Binder binder = _enclosing.WithAdditionalFlags(BinderFlags.UnsafeRegion);
721Binder statementBinder = lockBinder.WithAdditionalFlags(BinderFlags.InLockBody);
817Binder enclosing = _enclosing;
886Binder filterBinder = clauseBinder.WithAdditionalFlags(BinderFlags.InCatchFilter);
919Binder finallyBinder;
952var enclosing = _enclosing;
1009private void AddToMap(SyntaxNode node, Binder binder)
1023Binder existing;
1037private Binder GetBinderForPossibleEmbeddedStatement(StatementSyntax statement, Binder enclosing, out CSharpSyntaxNode embeddedScopeDesignator)
1069private Binder GetBinderForPossibleEmbeddedStatement(StatementSyntax statement, Binder enclosing)
1087private void VisitPossibleEmbeddedStatement(StatementSyntax statement, Binder enclosing)
Binder\LocalScopeBinder.cs (12)
25internal LocalScopeBinder(Binder next)
30internal LocalScopeBinder(Binder next, BinderFlags flags)
148protected ImmutableArray<LocalSymbol> BuildLocals(SyntaxList<StatementSyntax> statements, Binder enclosingBinder)
151Binder currentBinder = enclosingBinder;
173internal void BuildLocals(Binder enclosingBinder, StatementSyntax statement, ArrayBuilder<LocalSymbol> locals)
188Binder localDeclarationBinder = enclosingBinder.GetBinder(innerStatement) ?? enclosingBinder;
227Binder localFunctionDeclarationBinder = enclosingBinder.GetBinder(innerStatement) ?? enclosingBinder;
275Binder statementBinder = enclosingBinder.GetBinder(innerStatement);
287static void findExpressionVariablesInRankSpecifier(ExpressionSyntax expression, (LocalScopeBinder localScopeBinder, ArrayBuilder<LocalSymbol> locals, Binder localDeclarationBinder) args)
331protected SourceLocalSymbol MakeLocal(VariableDeclarationSyntax declaration, VariableDeclaratorSyntax declarator, LocalDeclarationKind kind, bool allowScoped, Binder initializerBinderOpt = null)
422LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
462internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
Binder\NameofBinder.cs (5)
24private readonly Binder? _withParametersBinder;
27internal NameofBinder(SyntaxNode nameofArgument, Binder next, WithTypeParametersBinder? withTypeParametersBinder, Binder? withParametersBinder)
52internal override void LookupSymbolsInSingleBinder(LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
84internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo info, LookupOptions options, Binder originalBinder)
Binder\Semantics\Conversions\Conversions.cs (8)
17private readonly Binder _binder;
19public Conversions(Binder binder)
24private Conversions(Binder binder, int currentRecursionDepth, bool includeNullability, Conversions otherNullabilityOpt)
65Binder.AddUseSiteDiagnosticForSynthesizedAttribute(
86Binder.AddUseSiteDiagnosticForSynthesizedAttribute(
97Binder.AddUseSiteDiagnosticForSynthesizedAttribute(
249private static MethodGroupResolution ResolveDelegateOrFunctionPointerMethodGroup(Binder binder, BoundMethodGroup source, MethodSymbol delegateInvokeMethodOpt, bool isFunctionPointer, in CallingConventionInfo callingConventionInfo, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
295public static bool ReportDelegateOrFunctionPointerMethodGroupDiagnostics(Binder binder, BoundMethodGroup expr, TypeSymbol targetType, BindingDiagnosticBag diagnostics)
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (15)
167Binder binder,
555private MethodTypeInferenceResult InferTypeArgs(Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
573private void InferTypeArgsFirstPhase(Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
594private void MakeExplicitParameterTypeInferences(Binder binder, BoundExpression argument, TypeWithAnnotations target, ExactOrBoundsKind kind, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
636Binder binder,
693private bool MakeExplicitParameterTypeInferences(Binder binder, BoundTupleLiteral argument, TypeWithAnnotations target, ExactOrBoundsKind kind, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
737private bool InferTypeArgsSecondPhase(Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
787private InferenceResult DoSecondPhase(Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
835private void MakeOutputTypeInferences(Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
849private void MakeOutputTypeInferences(Binder binder, BoundExpression argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
872private void MakeOutputTypeInferences(Binder binder, BoundUnconvertedCollectionExpression argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
893private void MakeOutputTypeInferences(Binder binder, BoundTupleLiteral argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1341private void OutputTypeInference(Binder binder, BoundExpression expression, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1410private bool MethodGroupReturnTypeInference(Binder binder, BoundExpression source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1477Binder binder, BoundMethodGroup source,
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (7)
189Binder binder,
643Binder binder,
680? Binder.WasImplicitReceiver(receiverOpt) && binder.InFieldInitializer && !binder.BindingTopLevelScriptCode
738Binder binder,
751Binder.ReportQueryInferenceFailed(queryClause, inferenceFailed.Member.Name, receiver, arguments, symbols, diagnostics);
1081Binder binder,
1151Binder binder,
Binder\WithExternAliasesBinder.cs (7)
22internal WithExternAliasesBinder(Binder next)
33LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
50internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
72internal static WithExternAliasesBinder Create(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, Binder next)
77internal static WithExternAliasesBinder Create(ImmutableArray<AliasAndExternAliasDirective> externAliases, Binder next)
88internal FromSyntax(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, Binder next)
114internal FromSymbols(ImmutableArray<AliasAndExternAliasDirective> externAliases, Binder next)
Binder\WithExternAndUsingAliasesBinder.cs (3)
37LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
54internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
93internal static new WithExternAndUsingAliasesBinder Create(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, Binder next)
Binder\WithLambdaParametersBinder.cs (3)
22public WithLambdaParametersBinder(LambdaSymbol lambdaSymbol, Binder enclosing)
87LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
102internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
Binder\WithParametersBinder.cs (3)
24internal WithParametersBinder(ImmutableArray<ParameterSymbol> parameters, Binder next)
31internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
46LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\WithPrimaryConstructorParametersBinder.cs (3)
21internal WithPrimaryConstructorParametersBinder(NamedTypeSymbol type, Binder next)
27internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
64LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\WithUsingNamespacesAndTypesBinder.cs (10)
25protected WithUsingNamespacesAndTypesBinder(Binder next, bool withImportChainEntry)
77Binder originalBinder)
131LookupResult result, string name, int arity, ConsList<TypeSymbol>? basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
139ImmutableArray<Symbol> candidates = Binder.GetCandidateMembers(typeOrNamespace.NamespaceOrType, name, options, originalBinder: originalBinder);
196internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
252internal static WithUsingNamespacesAndTypesBinder Create(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, Binder next, bool withPreviousSubmissionImports = false, bool withImportChainEntry = false)
262internal static WithUsingNamespacesAndTypesBinder Create(ImmutableArray<NamespaceOrTypeAndUsingDirective> namespacesOrTypes, Binder next, bool withImportChainEntry = false)
273internal FromSyntax(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, Binder next, bool withImportChainEntry)
303internal FromSyntaxWithPreviousSubmissionImports(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, Binder next, bool withImportChainEntry)
338internal FromNamespacesOrTypes(ImmutableArray<NamespaceOrTypeAndUsingDirective> namespacesOrTypes, Binder next, bool withImportChainEntry)
BoundTree\UnboundLambda.cs (21)
82public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? delegateType, InferredLambdaReturnType inferredReturnType)
186BoundLambda node, Binder binder, TypeSymbol? delegateType, bool isAsync, ConversionsBase conversions)
193UnboundLambda node, Binder binder, TypeSymbol? delegateType, bool isAsync, ConversionsBase conversions)
203BoundNode node, Binder binder, TypeSymbol? delegateType, bool isAsync, ConversionsBase conversions, bool withDependencies)
243Binder binder,
392Binder binder,
464public Binder GetWithParametersBinder(LambdaSymbol lambdaSymbol, Binder binder)
500internal readonly Binder Binder;
514public UnboundLambdaState(Binder binder, bool includeCache)
567protected BoundBlock BindLambdaBody(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics)
574Binder.RecordLambdaBinding(UnboundLambda.Syntax);
578protected abstract BoundBlock BindLambdaBodyCore(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics);
589protected abstract BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics);
782Binder lambdaBodyBinder;
852if (Binder.MethodOrLambdaRequiresValue(lambdaSymbol, this.Binder.Compilation))
1134public virtual Binder GetWithParametersBinder(LambdaSymbol lambdaSymbol, Binder binder)
1442Binder binder,
1579protected override BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics)
1584protected override BoundBlock BindLambdaBodyCore(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics)
CodeGen\EmitArrayInitializer.cs (6)
464var rosPointerCtor = (MethodSymbol?)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_ReadOnlySpan_T__ctor_Pointer, _diagnostics, syntax: wrappedExpression.Syntax, isOptional: true);
553EmitAddress(inPlaceTarget, Binder.AddressKind.Writeable);
610MethodSymbol? createSpan = (MethodSymbol?)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_Runtime_CompilerServices_RuntimeHelpers__CreateSpanRuntimeFieldHandle, _diagnostics, syntax: wrappedExpression.Syntax, isOptional: true);
705EmitAddress(inPlaceTarget, Binder.AddressKind.Writeable);
761EmitAddress(inPlaceTarget, Binder.AddressKind.Writeable);
779rosArrayCtor = (MethodSymbol?)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_ReadOnlySpan_T__ctor_Array, _diagnostics, syntax: syntax, isOptional: true);
CodeGen\EmitStatement.cs (9)
21using static Microsoft.CodeAnalysis.CSharp.Binder;
1393var int32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Int32, syntaxNode, _diagnostics);
1418var charType = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Char, syntaxNode, _diagnostics);
1518var UInt32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_UInt32, syntaxNode, _diagnostics);
1533var sequenceEqualsTMethod = (MethodSymbol)Binder.GetWellKnownTypeMember(_module.Compilation,
1539var sequenceEqualsCharMethod = sequenceEqualsTMethod.Construct(Binder.GetSpecialType(_module.Compilation, SpecialType.System_Char, syntaxNode, _diagnostics));
1542var asSpanMethod = (MethodSymbol)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_MemoryExtensions__AsSpan_String, _diagnostics, syntax: syntaxNode);
1628var spanTLengthMethod = (MethodSymbol)Binder.GetWellKnownTypeMember(_module.Compilation,
1652var spanTIndexerMethod = (MethodSymbol)Binder.GetWellKnownTypeMember(_module.Compilation,
Compilation\AttributeSemanticModel.cs (6)
26Binder rootBinder,
39public static AttributeSemanticModel Create(PublicSemanticModel containingSemanticModel, AttributeSyntax syntax, NamedTypeSymbol attributeType, AliasSymbol aliasOpt, Symbol? attributeTarget, Binder rootBinder, ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt)
48public static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, AttributeSyntax syntax, NamedTypeSymbol attributeType, AliasSymbol aliasOpt, Binder rootBinder, ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt, int position)
85internal override BoundNode Bind(Binder binder, CSharpSyntaxNode node, BindingDiagnosticBag diagnostics)
104Binder binder,
113protected override void AnalyzeBoundNodeNullability(BoundNode boundRoot, Binder binder, DiagnosticBag diagnostics, bool createSnapshots)
Compilation\CSharpSemanticModel.cs (49)
167internal abstract BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols);
202internal Binder GetSpeculativeBinder(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption)
216Binder binder = this.GetEnclosingBinder(position);
238private Binder GetSpeculativeBinderForAttribute(int position, AttributeSyntax attribute)
242var binder = this.GetEnclosingBinder(position);
251private static BoundExpression GetSpeculativelyBoundExpressionHelper(Binder binder, ExpressionSyntax expression, SpeculativeBindingOption bindingOption)
279protected BoundExpression GetSpeculativelyBoundExpressionWithoutNullability(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols)
324internal static ImmutableArray<Symbol> BindCref(CrefSyntax crefSyntax, Binder binder)
333var binder = this.GetEnclosingBinder(position);
399private BoundAttribute GetSpeculativelyBoundAttribute(int position, AttributeSyntax attribute, out Binder binder)
720Binder binder;
751Binder binder;
807var binder = memberModel.GetEnclosingBinder(position);
822private static SymbolInfo GetSymbolInfoFromBoundConstructorInitializer(MemberSemanticModel memberModel, Binder binder, BoundExpressionStatement bnode)
880var binder = memberModel.GetEnclosingBinder(LookupPosition.IsBetweenTokens(position, argumentList.OpenParenToken, argumentList.CloseParenToken) ? position : argumentList.OpenParenToken.SpanStart);
1197Binder binder;
1217internal Binder GetEnclosingBinder(int position)
1219Binder result = GetEnclosingBinderInternal(position);
1224internal abstract Binder GetEnclosingBinderInternal(int position);
1582var binder = GetEnclosingBinder(position);
1687private void AppendSymbolsWithName(ArrayBuilder<ISymbol> results, string name, Binder binder, NamespaceOrTypeSymbol container, LookupOptions options, LookupSymbolsInfo info)
1724Binder binder,
1822var binder = this.GetEnclosingBinder(position);
1871Binder binderOpt)
2208var binder = this.GetEnclosingBinder(boundExpr.Syntax.Span.Start);
2276Binder binderOpt)
2297Binder binderOpt)
2388internal virtual BoundNode Bind(Binder binder, CSharpSyntaxNode node, BindingDiagnosticBag diagnostics)
2764var binder = GetSpeculativeBinderForAttribute(position, attribute);
2851var binder = this.GetEnclosingBinder(position);
2903var binder = this.GetEnclosingBinder(position);
3266Binder enclosingBinder = this.GetEnclosingBinder(GetAdjustedNodePosition(forEachStatement));
3273Binder foreachBinder = enclosingBinder.GetBinder(forEachStatement);
3304Binder enclosingBinder = this.GetEnclosingBinder(GetAdjustedNodePosition(catchClause));
3311Binder catchBinder = enclosingBinder.GetBinder(catchClause);
3344Binder binderOpt,
3681Binder binder = binderOpt ?? GetEnclosingBinder(GetAdjustedNodePosition(boundNode.Syntax));
3964Binder binderOpt,
4017Binder binderOpt,
4032Binder binder = binderOpt ?? GetEnclosingBinder(GetAdjustedNodePosition(lowestBoundNode.Syntax));
4081private ImmutableArray<IPropertySymbol> GetIndexerGroupSemanticSymbols(BoundExpression boundNode, Binder binderOpt)
4092Binder binder = binderOpt ?? GetEnclosingBinder(GetAdjustedNodePosition(boundNode.Syntax));
4235Binder binderOpt,
4253Binder binder = binderOpt ?? GetEnclosingBinder(GetAdjustedNodePosition(boundNode.Syntax));
4381Binder binderOpt,
4554internal static ImmutableArray<MethodSymbol> GetReducedAndFilteredMethodGroupSymbols(Binder binder, BoundMethodGroup node)
4622var otherBinder = scope.Binder;
4903var binder = GetEnclosingBinder(position);
5401var binder = GetEnclosingBinder(position);
Compilation\InitializerSemanticModel.cs (10)
28Binder rootBinder,
39internal static InitializerSemanticModel Create(SyntaxTreeSemanticModel containingSemanticModel, CSharpSyntaxNode syntax, FieldSymbol fieldSymbol, Binder rootBinder)
49internal static InitializerSemanticModel Create(SyntaxTreeSemanticModel containingSemanticModel, CSharpSyntaxNode syntax, PropertySymbol propertySymbol, Binder rootBinder)
59internal static InitializerSemanticModel Create(PublicSemanticModel containingSemanticModel, ParameterSyntax syntax, ParameterSymbol parameterSymbol, Binder rootBinder, ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt)
69internal static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, Symbol owner, EqualsValueClauseSyntax syntax, Binder rootBinder, ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt, int position)
111internal override BoundNode Bind(Binder binder, CSharpSyntaxNode node, BindingDiagnosticBag diagnostics)
146private BoundEqualsValue BindEqualsValue(Binder binder, EqualsValueClauseSyntax equalsValue, BindingDiagnosticBag diagnostics)
205var binder = this.GetEnclosingBinder(position);
255Binder binder,
266protected override void AnalyzeBoundNodeNullability(BoundNode boundRoot, Binder binder, DiagnosticBag diagnostics, bool createSnapshots)
Compilation\MemberSemanticModel.cs (38)
39internal readonly Binder RootBinder;
48Binder rootBinder,
173var binder = this.GetSpeculativeBinder(position, expression, bindingOption);
191internal override BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols)
214private Binder GetEnclosingBinderInternalWithinRoot(SyntaxNode node, int position)
220private static Binder GetEnclosingBinderInternalWithinRoot(SyntaxNode node, int position, Binder rootBinder, SyntaxNode root)
232Binder binder = null;
385private static Binder AdjustBinderForPositionWithinStatement(int position, Binder binder, StatementSyntax stmt)
473var binder = this.GetEnclosingBinderInternal(expression, GetAdjustedNodePosition(expression));
497var binder = this.GetEnclosingBinderInternal(expression, GetAdjustedNodePosition(expression));
694for (var binder = this.GetEnclosingBinder(GetAdjustedNodePosition(declarationSyntax)); binder != null; binder = binder.Next)
735private static LocalFunctionSymbol GetDeclaredLocalFunction(Binder enclosingBinder, SyntaxToken declaredIdentifier)
737for (var binder = enclosingBinder; binder != null; binder = binder.Next)
755var binder = this.GetEnclosingBinder(GetAdjustedNodePosition(declarationSyntax));
781var binder = this.GetEnclosingBinder(GetAdjustedNodePosition(declarationSyntax));
1574internal override Binder GetEnclosingBinderInternal(int position)
1593private Binder GetEnclosingBinderInternal(CSharpSyntaxNode node, int position)
1648Binder lambdaRecoveryBinder;
1688Binder incrementalBinder = new IncrementalBinder(this, lambdaRecoveryBinder);
1738private Binder GetEnclosingBinderInLambdaOrQuery(int position, CSharpSyntaxNode node, CSharpSyntaxNode innerLambdaOrQuery, ref BoundNode boundInnerLambdaOrQuery)
1741Binder result;
1765private static Binder GetQueryEnclosingBinder(int position, CSharpSyntaxNode startingNode, BoundQueryClause queryClause)
1897private static Binder GetLambdaEnclosingBinder(int position, CSharpSyntaxNode startingNode, CSharpSyntaxNode containingLambda, Binder lambdaBinder)
1961Binder binder;
1985BoundNode bind(CSharpSyntaxNode root, out Binder binder)
2010private Binder GetBinderToBindNode(CSharpSyntaxNode nodeToBind)
2012Binder binder;
2041Binder binder,
2053protected abstract void AnalyzeBoundNodeNullability(BoundNode boundRoot, Binder binder, DiagnosticBag diagnostics, bool createSnapshots);
2109var statementBinder = GetBinderToBindNode(nodeToBind);
2110Binder incrementalBinder = new IncrementalBinder(this, statementBinder);
2130var binder = GetBinderToBindNode(node);
2395internal IncrementalBinder(MemberSemanticModel semanticModel, Binder next)
2405internal override Binder GetBinder(SyntaxNode node)
2407Binder binder = this.Next.GetBinder(node);
Compilation\MethodBodySemanticModel.cs (18)
23internal readonly Binder? Binder;
30Binder? binder = null,
45Binder rootBinder,
74internal override BoundNode Bind(Binder binder, CSharpSyntaxNode node, BindingDiagnosticBag diagnostics)
114Binder rootBinder,
126Binder rootBinder,
137internal static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, MethodSymbol owner, ArrowExpressionClauseSyntax syntax, Binder rootBinder, int position)
145internal static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, MethodSymbol owner, ConstructorInitializerSyntax syntax, Binder rootBinder, int position)
153internal static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, MethodSymbol owner, PrimaryConstructorBaseTypeSyntax syntax, Binder rootBinder, int position)
171Binder binder = this.RootBinder;
187Binder executablebinder = new WithNullableContextBinder(SyntaxTree, position, binder ?? this.RootBinder);
189var blockBinder = executablebinder.GetBinder(body).WithAdditionalFlags(GetSemanticModelBinderFlags());
205var binder = this.GetEnclosingBinder(position);
223var binder = this.GetEnclosingBinder(position);
243var binder = this.GetEnclosingBinder(position);
265var binder = this.GetEnclosingBinder(position);
288Binder binder,
298protected override void AnalyzeBoundNodeNullability(BoundNode boundRoot, Binder binder, DiagnosticBag diagnostics, bool createSnapshots)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (7)
47Binder rootBinder,
76Binder rootBinder,
92Binder rootBinder,
105Binder rootBinder,
495internal override Binder GetEnclosingBinderInternal(int position)
515internal override BoundNode Bind(Binder binder, CSharpSyntaxNode node, BindingDiagnosticBag diagnostics)
565internal override BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols)
Compilation\SpeculativeSyntaxTreeSemanticModel.cs (7)
23private readonly Binder _rootBinder;
27public static SpeculativeSyntaxTreeSemanticModel Create(SyntaxTreeSemanticModel parentSemanticModel, TypeSyntax root, Binder rootBinder, int position, SpeculativeBindingOption bindingOption)
32public static SpeculativeSyntaxTreeSemanticModel Create(SyntaxTreeSemanticModel parentSemanticModel, CrefSyntax root, Binder rootBinder, int position)
37private static SpeculativeSyntaxTreeSemanticModel CreateCore(SyntaxTreeSemanticModel parentSemanticModel, CSharpSyntaxNode root, Binder rootBinder, int position, SpeculativeBindingOption bindingOption)
49private SpeculativeSyntaxTreeSemanticModel(SyntaxTreeSemanticModel parentSemanticModel, CSharpSyntaxNode root, Binder rootBinder, int position, SpeculativeBindingOption bindingOption)
91internal override BoundNode Bind(Binder binder, CSharpSyntaxNode node, BindingDiagnosticBag diagnostics)
96internal override Binder GetEnclosingBinderInternal(int position)
Compilation\SyntaxTreeSemanticModel.cs (14)
148internal override Binder GetEnclosingBinderInternal(int position)
225var binder = this.GetEnclosingBinder(GetAdjustedNodePosition(node));
251var binder = this.GetEnclosingBinder(GetAdjustedNodePosition(node));
334var binder = this.GetEnclosingBinder(GetAdjustedNodePosition(node));
604Binder binder = GetSpeculativeBinder(position, type, bindingOption);
619Binder binder = GetEnclosingBinder(position);
738internal override BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols)
760internal PublicSemanticModel CreateSpeculativeAttributeSemanticModel(int position, AttributeSyntax attribute, Binder binder, AliasSymbol aliasOpt, NamedTypeSymbol attributeType)
1072Binder defaultOuter() => _binderFactory.GetBinder(node).WithAdditionalFlags(this.IgnoresAccessibility ? BinderFlags.IgnoreAccessibility : BinderFlags.None);
1276private Binder GetFieldOrPropertyInitializerBinder(FieldSymbol symbol, Binder outer, EqualsValueClauseSyntax initializer)
1866Binder binder = GetEnclosingBinder(declarationSyntax.Position);
1926Binder binder = _binderFactory.GetInNamespaceBinder(declarationSyntax.Parent);
1959var binder = _binderFactory.GetInNamespaceBinder(declarationSyntax.Parent);
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (4)
516Binder binder = BinderFactory.MakeCrefBinder(crefSyntax, memberDeclSyntax, _compilation.GetBinderFactory(memberDeclSyntax.SyntaxTree));
539Binder binder = MakeNameBinder(isParameter, isTypeParameterRef, _memberSymbol, _compilation, originatingSyntax.SyntaxTree);
547private static Binder MakeNameBinder(bool isParameter, bool isTypeParameterRef, Symbol memberSymbol, CSharpCompilation compilation, SyntaxTree syntaxTree)
549Binder binder = new BuckStopsHereBinder(compilation, FileIdentifier.Create(syntaxTree, compilation.Options.SourceReferenceResolver));
Compiler\MethodCompiler.cs (13)
474var processedStaticInitializers = new Binder.ProcessedFieldInitializers();
475var processedInstanceInitializers = new Binder.ProcessedFieldInitializers();
482Binder.BindFieldInitializers(_compilation, scriptInitializer, sourceTypeSymbol.StaticInitializers, _diagnostics, ref processedStaticInitializers);
485Binder.BindFieldInitializers(_compilation, scriptInitializer, sourceTypeSymbol.InstanceInitializers, _diagnostics, ref processedInstanceInitializers);
532Binder.ProcessedFieldInitializers processedInitializers =
535default(Binder.ProcessedFieldInitializers);
583var processedInitializers = default(Binder.ProcessedFieldInitializers);
638var processedInitializers = new Binder.ProcessedFieldInitializers() { BoundInitializers = ImmutableArray<BoundInitializer>.Empty };
888ref Binder.ProcessedFieldInitializers processedInitializers,
1776Binder bodyBinder = sourceMethod.TryGetBodyBinder();
1978CSharpSyntaxNode syntaxNode, Binder bodyBinder,
1990Binder current = bodyBinder;
2341var initializerInvocation = Binder.BindImplicitConstructorInitializer(method, diagnostics, compilation);
Emitter\Model\PEAssemblyBuilder.cs (5)
611Binder.ReportUseSite(result, diagnostics, Location.None);
618Binder.ReportUseSite(result, diagnostics, Location.None);
625Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__ctor, diagnostics, Location.None);
626Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__AllowMultiple, diagnostics, Location.None);
627Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__Inherited, diagnostics, Location.None);
FlowAnalysis\NullableWalker.cs (14)
170private readonly Binder _binder;
455Binder binder,
1379var binder = method is SynthesizedSimpleProgramEntryPointSymbol entryPoint ?
1409Binder.ProcessedFieldInitializers discardedInitializers = default;
1410Binder.BindFieldInitializers(compilation, null, method.IsStatic ? containingType.StaticInitializers : containingType.InstanceInitializers, BindingDiagnosticBag.Discarded, ref discardedInitializers);
1475Binder binder,
1490Binder binder,
1506Binder binder,
1564Binder binder,
1641Binder binder,
1721Binder binder,
4700Binder binder,
6698var nameSyntax = Binder.GetNameSyntax(syntax, out _);
7796var parameter = Binder.GetCorrespondingParameter(argumentOrdinal, parametersOpt, argsToParamsOpt, expanded);
Generated\BoundNodes.xml.Generated.cs (9)
6282public BoundUnconvertedObjectCreationExpression(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<(string Name, Location Location)?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, InitializerExpressionSyntax? initializerOpt, Binder binder, bool hasErrors = false)
6301public Binder Binder { get; }
6306public BoundUnconvertedObjectCreationExpression Update(ImmutableArray<BoundExpression> arguments, ImmutableArray<(string Name, Location Location)?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, InitializerExpressionSyntax? initializerOpt, Binder binder)
7592public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, LambdaSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type, bool hasErrors = false)
7613public Binder Binder { get; }
7618public BoundLambda Update(UnboundLambda unboundLambda, LambdaSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type)
7676public BoundQueryClause(SyntaxNode syntax, BoundExpression value, RangeVariableSymbol? definedSymbol, BoundExpression? operation, BoundExpression? cast, Binder binder, BoundExpression? unoptimizedForm, TypeSymbol type, bool hasErrors = false)
7697public Binder Binder { get; }
7703public BoundQueryClause Update(BoundExpression value, RangeVariableSymbol? definedSymbol, BoundExpression? operation, BoundExpression? cast, Binder binder, BoundExpression? unoptimizedForm, TypeSymbol type)
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);
Lowering\IteratorRewriter\IteratorRewriter.cs (3)
142Binder.TryGetSpecialTypeMember(F.Compilation, member, body.Syntax, bag, out symbol);
148Binder.GetSpecialType(F.Compilation, type, body.Syntax, bag);
162Binder.Error(bag, ErrorCode.ERR_PropertyLacksGet, body.Syntax, symbol);
Lowering\LocalRewriter\LocalRewriter.cs (2)
600symbol = (TSymbol?)Binder.GetWellKnownTypeMember(_compilation, member, _diagnostics, syntax: syntax, isOptional: isOptional, location: location);
643return Binder.TryGetSpecialTypeMember(compilation, specialMember, syntax, diagnostics, out method, isOptional);
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (10)
41ArrayBuilder<Binder.DeconstructionVariable> lhsTargets = GetAssignmentTargetsAndSideEffects(left, lhsTemps, lhsEffects);
44Binder.DeconstructionVariable.FreeDeconstructionVariables(lhsTargets);
56ArrayBuilder<Binder.DeconstructionVariable> lhsTargets,
152static bool canReorderTargetAssignments(ArrayBuilder<Binder.DeconstructionVariable> targets, ref PooledHashSet<Symbol>? visitedSymbols)
211ArrayBuilder<Binder.DeconstructionVariable> leftTargets,
443private ArrayBuilder<Binder.DeconstructionVariable> GetAssignmentTargetsAndSideEffects(BoundTupleExpression variables, ArrayBuilder<LocalSymbol> temps, ArrayBuilder<BoundExpression> effects)
445var assignmentTargets = ArrayBuilder<Binder.DeconstructionVariable>.GetInstance(variables.Arguments.Length);
452assignmentTargets.Add(new Binder.DeconstructionVariable(variable, variable.Syntax));
458assignmentTargets.Add(new Binder.DeconstructionVariable(GetAssignmentTargetsAndSideEffects(tuple, temps, effects), tuple.Syntax));
465assignmentTargets.Add(new Binder.DeconstructionVariable(temp, variable.Syntax));
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (3)
294disposeMethod = (MethodSymbol)Binder.GetWellKnownTypeMember(_compilation, WellKnownMember.System_IAsyncDisposable__DisposeAsync, _diagnostics, syntax: forEachSyntax);
298return Binder.TryGetSpecialTypeMember(_compilation, SpecialMember.System_IDisposable__Dispose, forEachSyntax, _diagnostics, out disposeMethod);
345Binder.ReportDiagnosticsIfObsolete(_diagnostics, disposeMethod, forEachSyntax,
Lowering\SyntheticBoundNodeFactory.cs (10)
261Binder.ReportUseSite(propertySym, Diagnostics, Syntax);
291Binder.ReportUseSite(specialType, Diagnostics, Syntax);
303Binder.ReportUseSite(wellKnownType, Diagnostics, Syntax);
317Symbol? wellKnownMember = Binder.GetWellKnownTypeMember(Compilation, wm, Diagnostics, syntax: Syntax, isOptional: true);
801Binder.ReportUseSite(methodSymbol, Diagnostics, Syntax);
809Binder.ReportUseSite(methodSymbol, Diagnostics, Syntax);
1209return Throw(Null(Binder.GetWellKnownType(Compilation, Microsoft.CodeAnalysis.WellKnownType.System_Exception, Diagnostics, Syntax.Location)));
1292return new BoundSizeOfOperator(Syntax, Type(type), Binder.GetConstantSizeOf(type), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32)) { WasCompilerGenerated = true };
1655if (!Binder.HasHome(argument,
1656Binder.AddressKind.ReadOnly,
Operations\CSharpOperationFactory.cs (7)
1262Create(Binder.GetUnderlyingCollectionExpressionElement(expr, (BoundExpression)element, throwOnErrors: false));
1268Binder.GetUnderlyingCollectionExpressionElement(expr, ((BoundExpressionStatement)iteratorBody).Expression, throwOnErrors: false) :
1648var lengthSymbol = Binder.GetPropertySymbol(boundIndexerAccess.LengthOrCountAccess, out _, out _).GetPublicSymbol();
1649var indexerSymbol = Binder.GetIndexerOrImplicitIndexerSymbol(boundIndexerAccess).GetPublicSymbol();
2609Binder.GetIndexerOrImplicitIndexerSymbol(boundNode.IndexerAccess).GetPublicSymbol(),
2621lengthSymbol: Binder.GetPropertySymbol(boundNode.LengthAccess, out _, out _).GetPublicSymbol(),
2622indexerSymbol: Binder.GetIndexerOrImplicitIndexerSymbol(boundNode.IndexerAccess).GetPublicSymbol(),
Symbols\Compilation_WellKnownMembers.cs (5)
394var ctorSymbol = (MethodSymbol)Binder.GetWellKnownTypeMember(this, constructor, useSiteInfo: out _, isOptional: true);
418var wellKnownMember = Binder.GetWellKnownTypeMember(this, arg.Key, useSiteInfo: out _, isOptional: true);
675var errorReported = Binder.ReportUseSite(userDefinedAttribute, diagnosticsOpt, locationOpt);
687var member = Binder.GetWellKnownTypeMember(this, attributeCtor,
691Binder.GetWellKnownTypeMember(this, secondAttributeCtor.Value, diagnosticsOpt, locationOpt);
Symbols\Source\ParameterHelpers.cs (18)
21Binder withTypeParametersBinder,
41parameterCreationFunc: (Binder context, Symbol owner, TypeWithAnnotations parameterType,
64Binder binder,
81parameterCreationFunc: (Binder binder, FunctionPointerMethodSymbol owner, TypeWithAnnotations parameterType,
114Binder withTypeParametersBinder,
124Func<Binder, TOwningSymbol, TypeWithAnnotations, TParameterSyntax, RefKind, int, SyntaxToken, SyntaxToken, bool, ScopedKind, BindingDiagnosticBag, TParameterSymbol> parameterCreationFunc,
442Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureExtensionMethod, diagnostics);
446Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureRefExtensionMethods, diagnostics);
474Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureRefExtensionMethods, diagnostics);
563Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureReadOnlyReferences, diagnostics);
567Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureRefExtensionMethods, diagnostics);
613Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureRefReadonlyParameters, diagnostics);
708Binder binder,
986internal static ImmutableArray<CustomModifier> ConditionallyCreateInModifiers(RefKind refKind, bool addRefReadOnlyModifier, Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
998internal static ImmutableArray<CustomModifier> CreateInModifiers(Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
1004private static ImmutableArray<CustomModifier> CreateRefReadonlyParameterModifiers(Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
1010internal static ImmutableArray<CustomModifier> CreateOutModifiers(Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
1015private static ImmutableArray<CustomModifier> CreateModifiers(WellKnownType modifier, Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
Symbols\Source\SourceComplexParameterSymbol.cs (13)
82private Binder WithTypeParametersBinderOpt => (ContainingSymbol as SourceMethodSymbolWithAttributes)?.WithTypeParametersBinder;
237MakeDefaultExpression(BindingDiagnosticBag.Discarded, out var _, out var parameterEqualsValue);
251MakeDefaultExpression(diagnostics, out var binder, out var parameterEqualsValue),
273Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(DeclaringCompilation,
293private Binder GetDefaultParameterValueBinder(SyntaxNode syntax)
295var binder = WithTypeParametersBinderOpt;
336var binder = GetDefaultParameterValueBinder(parameterSyntax);
359private ConstantValue MakeDefaultExpression(BindingDiagnosticBag diagnostics, out Binder? binder, out BoundParameterEqualsValue? parameterEqualsValue)
405valueBeforeConversion, diagnostics, Binder.ConversionForAssignmentFlags.DefaultParameter);
1568var binder = GetDefaultParameterValueBinder(syntax).WithContainingMemberOrLambda(ContainingSymbol); // this binder is good for our purpose
1627var binder = GetDefaultParameterValueBinder(syntax).WithContainingMemberOrLambda(ContainingSymbol); // this binder is good for our purpose
1659bool isAtLeastAsVisible(ParameterSyntax syntax, Binder binder, MethodSymbol method, BindingDiagnosticBag diagnostics)
1670void checkIsAtLeastAsVisible(ParameterSyntax syntax, Binder binder, MethodSymbol method, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceLocalSymbol.cs (24)
26private readonly Binder _scopeBinder;
43Binder scopeBinder,
77/// Binder that owns the scope for the local, the one that returns it in its <see cref="Binder.Locals"/> array.
79internal Binder ScopeBinder
94internal Binder TypeSyntaxBinder
124/// Binder that owns the scope for the local, the one that returns it in its <see cref="Binder.Locals"/> array.
137Binder scopeBinder,
138Binder nodeBinder,
157Binder scopeBinder,
158Binder nodeBinder,
188/// Binder that owns the scope for the local, the one that returns it in its <see cref="Binder.Locals"/> array.
202Binder scopeBinder,
209Binder initializerBinderOpt = null)
344Binder typeBinder = this.TypeSyntaxBinder;
515private readonly Binder _initializerBinder;
526Binder scopeBinder,
530Binder initializerBinder,
548for (var binder = _initializerBinder; binder != null; binder = binder.Next)
663private readonly Binder _nodeBinder;
667Binder scopeBinder,
668Binder nodeBinder,
726private readonly Binder _nodeBinder;
731Binder scopeBinder,
732Binder nodeBinder,
Symbols\Source\SourceMemberContainerSymbol.cs (9)
1362Binder.CheckFeatureAvailability(t.DeclaringSyntaxReferences[0].GetSyntax(), MessageID.IDS_DefaultInterfaceImplementation, diagnostics, t.GetFirstLocation());
1854Binder.ReportMissingTupleElementNamesAttributesIfNeeded(compilation, location, diagnostics);
2620_ = Binder.GetWellKnownTypeMember(DeclaringCompilation, WellKnownMember.System_Runtime_CompilerServices_RequiredMemberAttribute__ctor, diagnostics, GetFirstLocation());
2625_ = Binder.GetWellKnownTypeMember(DeclaringCompilation, WellKnownMember.System_Runtime_CompilerServices_CompilerFeatureRequiredAttribute__ctor, diagnostics, GetFirstLocation());
2630_ = Binder.GetWellKnownTypeMember(DeclaringCompilation, WellKnownMember.System_Diagnostics_CodeAnalysis_SetsRequiredMembersAttribute__ctor, diagnostics, GetFirstLocation());
3315Binder.Error(diagnostics, ErrorCode.ERR_SimpleProgramMultipleUnitsWithTopLevelStatements, singleDecl.NameLocation);
3592internal Binder GetBinder(CSharpSyntaxNode syntaxNode)
4548Binder.CheckFeatureAvailability(syntax, MessageID.IDS_FeaturePositionalFieldsInRecords, diagnostics);
4896var bodyBinder = this.GetBinder(firstMember);
Symbols\Source\SourcePropertySymbol.cs (10)
19internal static SourcePropertySymbol Create(SourceMemberContainerTypeSymbol containingType, Binder bodyBinder, PropertyDeclarationSyntax syntax, BindingDiagnosticBag diagnostics)
26internal static SourcePropertySymbol Create(SourceMemberContainerTypeSymbol containingType, Binder bodyBinder, IndexerDeclarationSyntax syntax, BindingDiagnosticBag diagnostics)
34Binder binder,
147Binder.CheckFeatureAvailability(
541private Binder CreateBinderForTypeAndParameters()
547var binder = binderFactory.GetBinder(syntax, syntax, this);
555Binder binder = CreateBinderForTypeAndParameters();
561private TypeWithAnnotations ComputeType(Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
600Binder binder, SourcePropertySymbolBase owner, BaseParameterListSyntax? parameterSyntaxOpt, BindingDiagnosticBag diagnostics, bool addRefReadOnlyModifier)
640private ImmutableArray<ParameterSymbol> ComputeParameters(Binder binder, CSharpSyntaxNode syntax, BindingDiagnosticBag diagnostics)
Symbols\Symbol_Attributes.cs (19)
304Binder? binderOpt = null,
312ImmutableArray<Binder> binders;
335Binder.BindAttributeTypes(binders, attributesToBind, this, attributeTypesBuilder, beforeAttributePartBound, afterAttributePartBound, diagnostics);
373Binder.GetAttributes(binders, attributesToBind, boundAttributeTypes, attributeDataArray, boundAttributeArray, beforeAttributePartBound, afterAttributePartBound, diagnostics);
422Binder attributeBinder = binders[i];
425Binder.CheckRequiredMembersInObjectInitializer(ctor, ImmutableArray<BoundExpression>.CastUp(boundAttribute.NamedArguments), boundAttribute.Syntax, diagnostics);
540protected ImmutableArray<(CSharpAttributeData, BoundAttribute)> BindAttributes(OneOrMany<SyntaxList<AttributeListSyntax>> attributeDeclarations, Binder? rootBinder)
545var binder = GetAttributeBinder(attributeListSyntaxList, DeclaringCompilation, rootBinder);
590Binder rootBinderOpt,
591out ImmutableArray<Binder> binders)
596ArrayBuilder<Binder> bindersBuilder = null;
614bindersBuilder = new ArrayBuilder<Binder>();
641var binder = GetAttributeBinder(attributeDeclarationSyntaxList, compilation, rootBinderOpt);
658binders = ImmutableArray<Binder>.Empty;
669private Binder GetAttributeBinder(SyntaxList<AttributeListSyntax> attributeDeclarationSyntaxList, CSharpCompilation compilation, Binder? rootBinder = null)
766ImmutableArray<Binder> binders,
838ImmutableArray<Binder> binders,
861Binder binder = binders[i];
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (7)
42_returnType = Binder.GetWellKnownType(compilation, WellKnownType.System_Threading_Tasks_Task, diagnostics, NoLocation.Singleton);
45_returnType = Binder.GetSpecialType(compilation, SpecialType.System_Void, NoLocation.Singleton, diagnostics);
48_returnType = Binder.GetWellKnownType(compilation, WellKnownType.System_Threading_Tasks_Task_T, diagnostics, NoLocation.Singleton).
49Construct(Binder.GetSpecialType(compilation, SpecialType.System_Int32, NoLocation.Singleton, diagnostics));
52_returnType = Binder.GetSpecialType(compilation, SpecialType.System_Int32, NoLocation.Singleton, diagnostics);
59TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_String, NoLocation.Singleton, diagnostics)))), 0, RefKind.None, "args"));
222Binder result = new BuckStopsHereBinder(compilation, FileIdentifier.Create(syntaxNode.SyntaxTree, compilation.Options.SourceReferenceResolver));
Symbols\Tuples\TupleTypeSymbol.cs (3)
254Binder.ReportUseSite(firstTupleType, diagnostics, syntax);
255Binder.ReportDiagnosticsIfObsoleteInternal(diagnostics, firstTupleType, syntax, firstTupleType.ContainingType, BinderFlags.None);
494Binder.Error(diagnostics, ErrorCode.ERR_PredefinedTypeMemberNotFoundInAssembly, syntax, relativeDescriptor.Name, type, type.ContainingAssembly);
Symbols\TypeWithAnnotations.cs (6)
539public void ReportDiagnosticsIfObsolete(Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) =>
547private void ReportDiagnosticsIfObsoleteCore(Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
877internal abstract void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics);
940internal override void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
1033internal override void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
1176internal override void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics)