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 (22)
453Binder initializerBinder = this.GetBinder(initializerOpt);
488internal Binder CreateBinderForParameterDefaultValue(
510Binder defaultValueBinder = this.GetBinder(defaultValueSyntax);
528Binder initializerBinder = this.GetBinder(equalsValueSyntax);
1741Binder current = this;
1793Binder binder = this;
1801if (binder is { Next: Binder withPrimaryConstructorParametersBinder })
4778Binder argumentListBinder = null;
5263static BoundNode bindElement(CollectionElementSyntax syntax, BindingDiagnosticBag diagnostics, Binder @this, int nestingLevel)
5274static BoundNode bindSpreadElement(SpreadElementSyntax syntax, BindingDiagnosticBag diagnostics, Binder @this)
5687var objectInitializerMemberBinder = useObjectInitDiagnostics
5714Binder objectInitializerMemberBinder,
6271var collectionInitializerAddMethodBinder = this.WithAdditionalFlags(BinderFlags.CollectionInitializerAddMethod);
6330Binder collectionInitializerAddMethodBinder,
6375Binder collectionInitializerAddMethodBinder = null,
6414Binder collectionInitializerAddMethodBinder,
6465Binder collectionInitializerAddMethodBinder,
6567Binder collectionInitializerAddMethodBinder,
7409var binder = this.GetBinder(node);
8603Binder binder,
8705Binder binder,
8783Binder binder,
Binder\Binder_Lookup.cs (42)
67private Binder LookupSymbolsWithFallback(LookupResult result, string name, int arity, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved = null, LookupOptions options = LookupOptions.Default)
72var binder = this.LookupSymbolsInternal(result, name, arity, basesBeingResolved, options, diagnose: false, useSiteInfo: ref useSiteInfo);
79var otherBinder = this.LookupSymbolsInternal(result, name, arity, basesBeingResolved, options, diagnose: true, useSiteInfo: ref useSiteInfo);
87private Binder LookupSymbolsInternal(
93Binder binder = null;
94for (var scope = this; scope != null && !result.IsMultiViable; scope = scope.Next)
122LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
170protected void LookupMembersInternal(LookupResult result, NamespaceOrTypeSymbol nsOrType, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
187int arity, LookupOptions options, Binder originalBinder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ref CompoundUseSiteInfo<AssemblySymbol> classicExtensionUseSiteInfo)
200string? name, int arity, LookupOptions options, Binder originalBinder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ref CompoundUseSiteInfo<AssemblySymbol> classicExtensionUseSiteInfo)
251protected void LookupMembersInType(LookupResult result, TypeSymbol type, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
292private void LookupMembersInErrorType(LookupResult result, ErrorTypeSymbol errorType, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
328LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
472Binder originalBinder,
515private static void LookupMembersInNamespace(LookupResult result, NamespaceSymbol ns, string name, int arity, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
536var binder = scope.Binder;
831Binder originalBinder)
843internal virtual void GetExtensionDeclarations(ArrayBuilder<NamedTypeSymbol> extensions, Binder originalBinder)
850LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved)
871Binder originalBinder,
886Binder originalBinder,
965Binder originalBinder,
1105Binder originalBinder,
1208Binder originalBinder,
1236private void LookupMembersInInterface(LookupResult current, NamedTypeSymbol type, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1254private void LookupMembersInTypeParameter(LookupResult current, TypeParameterSymbol typeParameter, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1379internal static ImmutableArray<Symbol> GetCandidateMembers(NamespaceOrTypeSymbol nsOrType, string name, LookupOptions options, Binder originalBinder)
1403internal static ImmutableArray<Symbol> GetCandidateMembers(NamespaceOrTypeSymbol nsOrType, LookupOptions options, Binder originalBinder)
1455for (var binder = this; binder != null; binder = binder.Next)
1917for (var scope = this; scope != null; scope = scope.Next)
1929internal virtual void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo info, LookupOptions options, Binder originalBinder)
1937internal void AddMemberLookupSymbolsInfo(LookupSymbolsInfo result, NamespaceOrTypeSymbol nsOrType, LookupOptions options, Binder originalBinder)
1949private void AddMemberLookupSymbolsInfoInType(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder)
1973protected void AddMemberLookupSymbolsInfoInSubmissions(LookupSymbolsInfo result, TypeSymbol scriptClass, bool inUsings, LookupOptions options, Binder originalBinder)
2005LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
2024static void addAliasSymbolToResult(LookupSymbolsInfo result, AliasSymbol aliasSymbol, LookupOptions options, Binder originalBinder)
2034private static void AddMemberLookupSymbolsInfoInNamespace(LookupSymbolsInfo result, NamespaceSymbol ns, LookupOptions options, Binder originalBinder)
2046private static void AddMemberLookupSymbolsInfoWithoutInheritance(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
2058private void AddWinRTMembersLookupSymbolsInfo(LookupSymbolsInfo result, NamedTypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
2073private void AddMemberLookupSymbolsInfoInClass(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
2104private void AddMemberLookupSymbolsInfoInInterface(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
2119private 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);
1885var binder = GetBinder(node);
2553static BoundStatement bindIfStatement(Binder binder, IfStatementSyntax node, BindingDiagnosticBag diagnostics)
2555var stack = ArrayBuilder<(Binder, IfStatementSyntax IfStatementSyntax, BoundExpression Condition, BoundStatement Consequence)>.GetInstance();
2573var b = binder.GetBinder(ifStatementSyntax);
2757Binder switchBinder = this.GetBinder(node);
2761internal virtual BoundStatement BindSwitchStatementCore(SwitchStatementSyntax node, Binder originalBinder, BindingDiagnosticBag diagnostics)
2775var loopBinder = this.GetBinder(node);
2780internal virtual BoundWhileStatement BindWhileParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
2787var loopBinder = this.GetBinder(node);
2793internal virtual BoundDoStatement BindDoParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
2800var loopBinder = this.GetBinder(node);
2805internal virtual BoundForStatement BindForParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
2898Binder loopBinder = this.GetBinder(node);
2902internal virtual BoundStatement BindForEachParts(BindingDiagnosticBag diagnostics, Binder originalBinder)
2910internal virtual BoundStatement BindForEachDeconstruction(BindingDiagnosticBag diagnostics, Binder originalBinder)
2937private static SwitchBinder GetSwitchBinder(Binder binder)
3244var catchBinder = this.GetBinder(catchSyntax);
3293var filterBinder = this.GetBinder(filter);
3343var binder = GetBinder(node);
3583Binder bodyBinder = this.GetBinder(expressionBody);
3589static BoundBlock bindExpressionBodyAsBlockInternal(ArrowExpressionClauseSyntax expressionBody, Binder bodyBinder, BindingDiagnosticBag diagnostics)
3604Binder bodyBinder = this.GetBinder(body);
3616Binder bodyBinder = this.GetBinder(body);
3704Binder initializerBinder = GetBinder(baseWithArguments);
3738Binder bodyBinder = this.GetBinder(constructor);
3881Binder outerBinder;
3925Binder initializerBinder = outerBinder.WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags.ConstructorInitializer, constructor);
3953if (Binder.ReportUseSite(baseConstructor, diagnostics, diagnosticsLocation))
4009Binder.ReportConstructorUseSiteDiagnostics(diagnosticsLocation, diagnostics, suppressUnsupportedRequiredMembersError: constructor.HasSetsRequiredMembers, constructorUseSiteInfo);
Binder\BinderFactory.BinderFactoryVisitor.cs (84)
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)
653public override Binder VisitDelegateDeclaration(DelegateDeclarationSyntax parent)
662Binder resultBinder;
665Binder outer = VisitCore(parent.Parent); // a binder for the body of the enclosing type or namespace
685public override Binder VisitEnumDeclaration(EnumDeclarationSyntax parent)
697Binder resultBinder;
700Binder outer = VisitCore(parent.Parent); // a binder for the body of the type enclosing this type
716private Binder VisitTypeDeclarationCore(TypeDeclarationSyntax parent)
749internal Binder VisitTypeDeclarationCore(TypeDeclarationSyntax parent, NodeUsage extraInfo)
753Binder resultBinder;
800public override Binder VisitClassDeclaration(ClassDeclarationSyntax node)
805public override Binder VisitStructDeclaration(StructDeclarationSyntax node)
810public override Binder VisitInterfaceDeclaration(InterfaceDeclarationSyntax node)
815public override Binder VisitRecordDeclaration(RecordDeclarationSyntax node)
818public override Binder VisitExtensionDeclaration(ExtensionDeclarationSyntax node)
821public sealed override Binder VisitNamespaceDeclaration(NamespaceDeclarationSyntax parent)
837public override Binder VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax parent)
852internal Binder VisitNamespaceDeclaration(BaseNamespaceDeclarationSyntax parent, int position, bool inBody, bool inUsing)
859Binder result;
862Binder outer;
894private static Binder MakeNamespaceBinder(CSharpSyntaxNode node, NameSyntax name, Binder outer, bool inUsing)
930public override Binder VisitCompilationUnit(CompilationUnitSyntax parent)
938internal Binder VisitCompilationUnit(CompilationUnitSyntax compilationUnit, bool inUsing, bool inScript)
950Binder result;
1033private static Binder AddInImportsBinders(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, Binder next, bool inUsing)
1100public override Binder VisitDocumentationCommentTrivia(DocumentationCommentTriviaSyntax parent)
1109public override Binder VisitCrefParameter(CrefParameterSyntax parent)
1118public override Binder VisitConversionOperatorMemberCref(ConversionOperatorMemberCrefSyntax parent)
1129public override Binder VisitXmlCrefAttribute(XmlCrefAttributeSyntax parent)
1140private Binder VisitXmlCrefAttributeInternal(XmlCrefAttributeSyntax parent, NodeUsage extraInfo)
1147Binder result;
1165public override Binder VisitXmlNameAttribute(XmlNameAttributeSyntax parent)
1196Binder result;
1201Binder outerBinder = VisitCore(GetEnclosingDocumentationComment(parent));
1237private Binder GetParameterNameAttributeValueBinder(MemberDeclarationSyntax memberSyntax, Binder nextBinder)
1241Binder outerBinder = VisitCore(memberSyntax.Parent);
1249Binder outerBinder = VisitCore(memberSyntax);
1264Binder outerBinder = VisitCore(memberSyntax.Parent);
1286Binder outerBinder = VisitCore(memberSyntax.Parent);
1305private Binder GetTypeParameterNameAttributeValueBinder(MemberDeclarationSyntax memberSyntax, bool includeContainingSymbols, Binder nextBinder)
1309Binder outerBinder = VisitCore(memberSyntax.Parent);
1323Binder outerBinder = VisitCore(memberSyntax.Parent);
1335Binder outerBinder = VisitCore(memberSyntax.Parent);
1342Binder outerBinder = VisitCore(memberSyntax.Parent);
1370internal static Binder MakeCrefBinder(CrefSyntax crefSyntax, MemberDeclarationSyntax memberSyntax, BinderFactory factory, bool inParameterOrReturnType = false)
1375Binder binder = memberSyntax is BaseTypeDeclarationSyntax typeDeclSyntax
1381Binder getBinder(BaseTypeDeclarationSyntax baseTypeDeclaration)
1395private 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 (5)
28internal InContainerBinder(NamespaceOrTypeSymbol container, Binder next)
80Binder originalBinder)
88internal override void GetExtensionDeclarations(ArrayBuilder<NamedTypeSymbol> extensions, Binder originalBinder)
112LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
139internal 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)
26private readonly Binder? _withParametersBinder;
31internal NameofBinder(ExpressionSyntax nameofArgument, Binder next, WithTypeParametersBinder? withTypeParametersBinder, Binder? withParametersBinder)
60internal override void LookupSymbolsInSingleBinder(LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
92internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo info, LookupOptions options, Binder originalBinder)
Binder\Semantics\Conversions\Conversions.cs (9)
17private readonly Binder _binder;
19public Conversions(Binder binder)
24private Conversions(Binder binder, int currentRecursionDepth, bool includeNullability, Conversions otherNullabilityOpt)
65Binder.AddUseSiteDiagnosticForSynthesizedAttribute(
86Binder.AddUseSiteDiagnosticForSynthesizedAttribute(
97Binder.AddUseSiteDiagnosticForSynthesizedAttribute(
251private static MethodGroupResolution ResolveDelegateOrFunctionPointerMethodGroup(Binder binder, BoundMethodGroup source, MethodSymbol delegateInvokeMethodOpt, bool isFunctionPointer, in CallingConventionInfo callingConventionInfo, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
300public static bool ReportDelegateOrFunctionPointerMethodGroupDiagnostics(Binder binder, BoundMethodGroup expr, TypeSymbol targetType, BindingDiagnosticBag diagnostics)
473if (!(method.GetIsNewExtensionMember() && method.IsStatic) && !Binder.GetReceiverParameter(method).Type.IsReferenceType)
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (15)
171Binder binder,
580private MethodTypeInferenceResult InferTypeArgs(Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
598private void InferTypeArgsFirstPhase(Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
619private void MakeExplicitParameterTypeInferences(Binder binder, BoundExpression argument, TypeWithAnnotations target, ExactOrBoundsKind kind, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
661Binder binder,
718private bool MakeExplicitParameterTypeInferences(Binder binder, BoundTupleLiteral argument, TypeWithAnnotations target, ExactOrBoundsKind kind, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
762private bool InferTypeArgsSecondPhase(Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
812private InferenceResult DoSecondPhase(Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
860private void MakeOutputTypeInferences(Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
874private void MakeOutputTypeInferences(Binder binder, BoundExpression argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
897private void MakeOutputTypeInferences(Binder binder, BoundUnconvertedCollectionExpression argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
918private void MakeOutputTypeInferences(Binder binder, BoundTupleLiteral argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1366private void OutputTypeInference(Binder binder, BoundExpression expression, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1435private bool MethodGroupReturnTypeInference(Binder binder, BoundExpression source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1502Binder 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\WithExtensionParameterBinder.cs (3)
18internal WithExtensionParameterBinder(NamedTypeSymbol type, Binder next)
24internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
37LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
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 (11)
25protected WithUsingNamespacesAndTypesBinder(Binder next, bool withImportChainEntry)
79Binder originalBinder)
132internal override void GetExtensionDeclarations(ArrayBuilder<NamedTypeSymbol> extensions, Binder originalBinder)
158LookupResult result, string name, int arity, ConsList<TypeSymbol>? basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
166ImmutableArray<Symbol> candidates = Binder.GetCandidateMembers(typeOrNamespace.NamespaceOrType, name, options, originalBinder: originalBinder);
223internal override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
279internal static WithUsingNamespacesAndTypesBinder Create(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, Binder next, bool withPreviousSubmissionImports = false, bool withImportChainEntry = false)
289internal static WithUsingNamespacesAndTypesBinder Create(ImmutableArray<NamespaceOrTypeAndUsingDirective> namespacesOrTypes, Binder next, bool withImportChainEntry = false)
300internal FromSyntax(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, Binder next, bool withImportChainEntry)
330internal FromSyntaxWithPreviousSubmissionImports(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, Binder next, bool withImportChainEntry)
365internal 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)
521internal readonly Binder Binder;
535public UnboundLambdaState(Binder binder, bool includeCache)
588protected BoundBlock BindLambdaBody(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics)
595Binder.RecordLambdaBinding(UnboundLambda.Syntax);
599protected abstract BoundBlock BindLambdaBodyCore(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics);
610protected abstract BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics);
803Binder lambdaBodyBinder;
873if (Binder.MethodOrLambdaRequiresValue(lambdaSymbol, this.Binder.Compilation))
1155public virtual Binder GetWithParametersBinder(LambdaSymbol lambdaSymbol, Binder binder)
1463Binder binder,
1600protected override BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics)
1605protected override BoundBlock BindLambdaBodyCore(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, BindingDiagnosticBag diagnostics)
CodeGen\EmitArrayInitializer.cs (3)
464var rosPointerCtor = (MethodSymbol?)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_ReadOnlySpan_T__ctor_Pointer, _diagnostics, syntax: wrappedExpression.Syntax, isOptional: true);
610MethodSymbol? createSpan = (MethodSymbol?)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_Runtime_CompilerServices_RuntimeHelpers__CreateSpanRuntimeFieldHandle, _diagnostics, syntax: wrappedExpression.Syntax, isOptional: true);
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 (48)
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);
1695private void AppendSymbolsWithName(ArrayBuilder<ISymbol> results, string name, Binder binder, NamespaceOrTypeSymbol container, LookupOptions options, LookupSymbolsInfo info)
1732Binder binder,
1830var binder = this.GetEnclosingBinder(position);
1879Binder binderOpt)
2216var binder = this.GetEnclosingBinder(boundExpr.Syntax.Span.Start);
2284Binder binderOpt)
2305Binder binderOpt)
2396internal virtual BoundNode Bind(Binder binder, CSharpSyntaxNode node, BindingDiagnosticBag diagnostics)
2772var binder = GetSpeculativeBinderForAttribute(position, attribute);
2859var binder = this.GetEnclosingBinder(position);
2911var binder = this.GetEnclosingBinder(position);
3274Binder enclosingBinder = this.GetEnclosingBinder(GetAdjustedNodePosition(forEachStatement));
3281Binder foreachBinder = enclosingBinder.GetBinder(forEachStatement);
3312Binder enclosingBinder = this.GetEnclosingBinder(GetAdjustedNodePosition(catchClause));
3319Binder catchBinder = enclosingBinder.GetBinder(catchClause);
3352Binder binderOpt,
3690Binder binder = binderOpt ?? GetEnclosingBinder(GetAdjustedNodePosition(boundNode.Syntax));
3973Binder binderOpt,
4026Binder binderOpt,
4041Binder binder = binderOpt ?? GetEnclosingBinder(GetAdjustedNodePosition(lowestBoundNode.Syntax));
4090private ImmutableArray<IPropertySymbol> GetIndexerGroupSemanticSymbols(BoundExpression boundNode, Binder binderOpt)
4101Binder binder = binderOpt ?? GetEnclosingBinder(GetAdjustedNodePosition(boundNode.Syntax));
4244Binder binderOpt,
4262Binder binder = binderOpt ?? GetEnclosingBinder(GetAdjustedNodePosition(boundNode.Syntax));
4397Binder binderOpt,
4570internal static ImmutableArray<Symbol> GetReducedAndFilteredMethodGroupSymbols(Binder binder, BoundMethodGroup node)
4911var binder = GetEnclosingBinder(position);
5409var 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)
115Binder rootBinder,
127Binder rootBinder,
138internal static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, MethodSymbol owner, ArrowExpressionClauseSyntax syntax, Binder rootBinder, int position)
146internal static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, MethodSymbol owner, ConstructorInitializerSyntax syntax, Binder rootBinder, int position)
154internal static SpeculativeSemanticModelWithMemberModel CreateSpeculative(SyntaxTreeSemanticModel parentSemanticModel, MethodSymbol owner, PrimaryConstructorBaseTypeSyntax syntax, Binder rootBinder, int position)
172Binder binder = this.RootBinder;
188Binder executablebinder = new WithNullableContextBinder(SyntaxTree, position, binder ?? this.RootBinder);
190var blockBinder = executablebinder.GetBinder(body).WithAdditionalFlags(GetSemanticModelBinderFlags());
206var binder = this.GetEnclosingBinder(position);
224var binder = this.GetEnclosingBinder(position);
244var binder = this.GetEnclosingBinder(position);
266var binder = this.GetEnclosingBinder(position);
289Binder binder,
299protected 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)
1074Binder defaultOuter() => _binderFactory.GetBinder(node).WithAdditionalFlags(this.IgnoresAccessibility ? BinderFlags.IgnoreAccessibility : BinderFlags.None);
1279private Binder GetFieldOrPropertyInitializerBinder(FieldSymbol symbol, Binder outer, EqualsValueClauseSyntax initializer)
1890Binder binder = GetEnclosingBinder(declarationSyntax.Position);
1950Binder binder = _binderFactory.GetInNamespaceBinder(declarationSyntax.Parent);
1983var 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)
476var processedStaticInitializers = new Binder.ProcessedFieldInitializers();
477var processedInstanceInitializers = new Binder.ProcessedFieldInitializers();
484Binder.BindFieldInitializers(_compilation, scriptInitializer, sourceTypeSymbol.StaticInitializers, _diagnostics, ref processedStaticInitializers);
487Binder.BindFieldInitializers(_compilation, scriptInitializer, sourceTypeSymbol.InstanceInitializers, _diagnostics, ref processedInstanceInitializers);
534Binder.ProcessedFieldInitializers processedInitializers =
537default(Binder.ProcessedFieldInitializers);
595var processedInitializers = default(Binder.ProcessedFieldInitializers);
650var processedInitializers = new Binder.ProcessedFieldInitializers() { BoundInitializers = ImmutableArray<BoundInitializer>.Empty };
903ref Binder.ProcessedFieldInitializers processedInitializers,
1876Binder bodyBinder = sourceMethod.TryGetBodyBinder();
2078CSharpSyntaxNode syntaxNode, Binder bodyBinder,
2090Binder current = bodyBinder;
2441var initializerInvocation = Binder.BindImplicitConstructorInitializer(method, diagnostics, compilation);
Emitter\Model\PEAssemblyBuilder.cs (5)
627Binder.ReportUseSite(result, diagnostics, Location.None);
634Binder.ReportUseSite(result, diagnostics, Location.None);
641Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__ctor, diagnostics, Location.None);
642Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__AllowMultiple, diagnostics, Location.None);
643Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__Inherited, diagnostics, Location.None);
FlowAnalysis\NullableWalker.cs (14)
170private readonly Binder _binder;
462Binder binder,
1451var binder = method is SynthesizedSimpleProgramEntryPointSymbol entryPoint ?
1482Binder.ProcessedFieldInitializers discardedInitializers = default;
1483Binder.BindFieldInitializers(compilation, null, method.IsStatic ? containingType.StaticInitializers : containingType.InstanceInitializers, BindingDiagnosticBag.Discarded, ref discardedInitializers);
1548Binder binder,
1563Binder binder,
1579Binder binder,
1638Binder binder,
1716Binder binder,
1799Binder binder,
4820Binder binder,
6827var nameSyntax = Binder.GetNameSyntax(syntax, out _);
7928var parameter = Binder.GetCorrespondingParameter(argumentOrdinal, parametersOpt, argsToParamsOpt, expanded);
Generated\BoundNodes.xml.Generated.cs (9)
6281public BoundUnconvertedObjectCreationExpression(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<(string Name, Location Location)?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, InitializerExpressionSyntax? initializerOpt, Binder binder, bool hasErrors = false)
6300public Binder Binder { get; }
6305public BoundUnconvertedObjectCreationExpression Update(ImmutableArray<BoundExpression> arguments, ImmutableArray<(string Name, Location Location)?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, InitializerExpressionSyntax? initializerOpt, Binder binder)
7591public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, MethodSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type, bool hasErrors = false)
7612public Binder Binder { get; }
7617public BoundLambda Update(UnboundLambda unboundLambda, MethodSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type)
7675public BoundQueryClause(SyntaxNode syntax, BoundExpression value, RangeVariableSymbol? definedSymbol, BoundExpression? operation, BoundExpression? cast, Binder binder, BoundExpression? unoptimizedForm, TypeSymbol type, bool hasErrors = false)
7696public Binder Binder { get; }
7702public 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 (8)
269Binder.ReportUseSite(propertySym, Diagnostics, Syntax);
299Binder.ReportUseSite(specialType, Diagnostics, Syntax);
311Binder.ReportUseSite(wellKnownType, Diagnostics, Syntax);
325Symbol? wellKnownMember = Binder.GetWellKnownTypeMember(Compilation, wm, Diagnostics, syntax: Syntax, isOptional: true);
814Binder.ReportUseSite(methodSymbol, Diagnostics, Syntax);
822Binder.ReportUseSite(methodSymbol, Diagnostics, Syntax);
1227return Throw(Null(Binder.GetWellKnownType(Compilation, Microsoft.CodeAnalysis.WellKnownType.System_Exception, Diagnostics, Syntax.Location)));
1310return new BoundSizeOfOperator(Syntax, Type(type), Binder.GetConstantSizeOf(type), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32)) { WasCompilerGenerated = true };
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 (22)
21Binder withTypeParametersBinder,
41parameterCreationFunc: static (Binder context, Symbol owner, TypeWithAnnotations parameterType,
65Binder withTypeParametersBinder,
70var parameterCreationFunc = static (Binder context, Symbol owner, TypeWithAnnotations parameterType,
116Binder binder,
133parameterCreationFunc: static (Binder binder, FunctionPointerMethodSymbol owner, TypeWithAnnotations parameterType,
167Binder withTypeParametersBinder,
177Func<Binder, TOwningSymbol, TypeWithAnnotations, TParameterSyntax, RefKind, int, SyntaxToken, SyntaxToken, bool, ScopedKind, BindingDiagnosticBag, TParameterSymbol> parameterCreationFunc,
247Binder withTypeParametersBinder,
257Func<Binder, TOwningSymbol, TypeWithAnnotations, TParameterSyntax, RefKind, int, SyntaxToken, SyntaxToken, bool, ScopedKind, BindingDiagnosticBag, TParameterSymbol> parameterCreationFunc,
543Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureExtensionMethod, diagnostics);
547Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureRefExtensionMethods, diagnostics);
576Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureRefExtensionMethods, diagnostics);
674Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureReadOnlyReferences, diagnostics);
678Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureRefExtensionMethods, diagnostics);
724Binder.CheckFeatureAvailability(modifier, MessageID.IDS_FeatureRefReadonlyParameters, diagnostics);
831Binder binder,
1119internal static ImmutableArray<CustomModifier> ConditionallyCreateInModifiers(RefKind refKind, bool addRefReadOnlyModifier, Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
1131internal static ImmutableArray<CustomModifier> CreateInModifiers(Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
1137private static ImmutableArray<CustomModifier> CreateRefReadonlyParameterModifiers(Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
1143internal static ImmutableArray<CustomModifier> CreateOutModifiers(Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
1148private static ImmutableArray<CustomModifier> CreateModifiers(WellKnownType modifier, Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
Symbols\Source\SourceAssemblySymbol.cs (13)
655Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(compilation,
664Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(compilation,
667Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(compilation,
701Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(compilation,
720Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(compilation,
724Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(compilation,
794Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(_compilation,
841Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(_compilation,
1669Func<AttributeSyntax, Binder?, bool> attributeMatches = attribute switch
1681bool isPossibleAssemblySignatureKeyAttribute(AttributeSyntax node, Binder? rootBinderOpt)
1687bool isPossibleAssemblyKeyNameAttribute(AttributeSyntax node, Binder? rootBinderOpt)
1693bool isPossibleAssemblyKeyFileAttribute(AttributeSyntax node, Binder? rootBinderOpt)
1759private bool IsPossibleForwardedTypesAttribute(AttributeSyntax node, Binder rootBinderOpt)
Symbols\Source\SourceComplexParameterSymbol.cs (13)
82private Binder WithTypeParametersBinderOpt => (ContainingSymbol as SourceMethodSymbol)?.WithTypeParametersBinder;
238MakeDefaultExpression(BindingDiagnosticBag.Discarded, out var _, out var parameterEqualsValue);
252MakeDefaultExpression(diagnostics, out var binder, out var parameterEqualsValue),
274Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(DeclaringCompilation,
294private Binder GetDefaultParameterValueBinder(SyntaxNode syntax)
296var binder = WithTypeParametersBinderOpt;
337var binder = GetDefaultParameterValueBinder(parameterSyntax);
360private ConstantValue MakeDefaultExpression(BindingDiagnosticBag diagnostics, out Binder? binder, out BoundParameterEqualsValue? parameterEqualsValue)
406valueBeforeConversion, diagnostics, Binder.ConversionForAssignmentFlags.DefaultParameter);
1564var binder = GetDefaultParameterValueBinder(syntax).WithContainingMemberOrLambda(ContainingSymbol); // this binder is good for our purpose
1622var binder = GetDefaultParameterValueBinder(syntax).WithContainingMemberOrLambda(ContainingSymbol); // this binder is good for our purpose
1654bool isAtLeastAsVisible(ParameterSyntax syntax, Binder binder, MethodSymbol method, BindingDiagnosticBag diagnostics)
1665void 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\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(
554private Binder CreateBinderForTypeAndParameters()
560var binder = binderFactory.GetBinder(syntax, syntax, this);
568Binder binder = CreateBinderForTypeAndParameters();
574private TypeWithAnnotations ComputeType(Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
622Binder binder, SourcePropertySymbolBase owner, BaseParameterListSyntax? parameterSyntaxOpt, BindingDiagnosticBag diagnostics, bool addRefReadOnlyModifier)
662private ImmutableArray<ParameterSymbol> ComputeParameters(Binder binder, CSharpSyntaxNode syntax, BindingDiagnosticBag diagnostics)
Symbols\Symbol_Attributes.cs (21)
304Binder? binderOpt = null,
305Func<AttributeSyntax, Binder?, bool>? attributeMatchesOpt = 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);
589Func<AttributeSyntax, Binder, bool> attributeMatchesOpt,
590Binder rootBinderOpt,
591out ImmutableArray<Binder> binders)
596ArrayBuilder<Binder> bindersBuilder = null;
614bindersBuilder = new ArrayBuilder<Binder>();
641var binder = GetAttributeBinder(attributeDeclarationSyntaxList, compilation, rootBinderOpt);
658binders = ImmutableArray<Binder>.Empty;
669protected 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)