13 types derived from Symbol
Microsoft.CodeAnalysis.CSharp (13)
Symbols\AliasSymbol.cs (1)
48internal abstract class AliasSymbol : Symbol
Symbols\AssemblySymbol.cs (1)
25internal abstract class AssemblySymbol : Symbol, IAssemblySymbolInternal
Symbols\DiscardSymbol.cs (1)
11internal sealed class DiscardSymbol : Symbol
Symbols\EventSymbol.cs (1)
17internal abstract partial class EventSymbol : Symbol
Symbols\FieldSymbol.cs (1)
22internal abstract partial class FieldSymbol : Symbol, IFieldSymbolInternal
Symbols\LabelSymbol.cs (1)
16internal abstract class LabelSymbol : Symbol
Symbols\LocalSymbol.cs (1)
20internal abstract class LocalSymbol : Symbol, ILocalSymbolInternal
Symbols\MethodSymbol.cs (1)
26internal abstract partial class MethodSymbol : Symbol, IMethodSymbolInternal
Symbols\ModuleSymbol.cs (1)
21internal abstract class ModuleSymbol : Symbol, IModuleSymbolInternal
Symbols\NamespaceOrTypeSymbol.cs (1)
20internal abstract class NamespaceOrTypeSymbol : Symbol, INamespaceOrTypeSymbolInternal
Symbols\ParameterSymbol.cs (1)
17internal abstract partial class ParameterSymbol : Symbol, IParameterSymbolInternal
Symbols\PropertySymbol.cs (1)
19internal abstract partial class PropertySymbol : Symbol, IPropertySymbolInternal
Symbols\RangeVariableSymbol.cs (1)
16internal class RangeVariableSymbol : Symbol
3102 references to Symbol
Microsoft.CodeAnalysis.CSharp (3048)
Binder\Binder.cs (19)
240internal virtual Symbol? ContainingMemberOrLambda 426var member = this.ContainingMemberOrLambda; 444var containingMember = this.ContainingMemberOrLambda; 592internal void ReportDiagnosticsIfObsolete(DiagnosticBag diagnostics, Symbol symbol, SyntaxNode node, bool hasBaseReceiver) 602internal void ReportDiagnosticsIfObsolete(DiagnosticBag diagnostics, Symbol symbol, SyntaxNodeOrToken node, bool hasBaseReceiver) 616internal void ReportDiagnosticsIfObsolete(BindingDiagnosticBag diagnostics, Symbol symbol, SyntaxNodeOrToken node, bool hasBaseReceiver) 634Symbol symbol, 637Symbol? containingMember, 661Symbol leastOverriddenSymbol = symbol.GetLeastOverriddenMember(containingType); 700Symbol symbol, 703Symbol? containingMember, 713internal static ObsoleteDiagnosticKind ReportDiagnosticsIfObsoleteInternal(DiagnosticBag diagnostics, Symbol symbol, SyntaxNodeOrToken node, Symbol? containingMember, BinderFlags location) 744internal static void ReportDiagnosticsIfObsoleteInternal(BindingDiagnosticBag diagnostics, Symbol symbol, SyntaxNodeOrToken node, Symbol containingMember, BinderFlags location) 772Symbol symbol, 780Symbol symbol, 789Symbol symbol, 917var currentContainer = scope.ContainingMemberOrLambda;
Binder\Binder.IdentifierUsedAsValueFinder.cs (2)
271var members = ArrayBuilder<Symbol>.GetInstance(); 272Symbol symbol = enclosingBinder.GetSymbolOrMethodOrPropertyGroup(lookupResult, memberAccessNode, memberName, targetMemberArity, members, BindingDiagnosticBag.Discarded, wasError: out _,
Binder\Binder.NamespaceOrTypeOrAliasSymbolWithAnnotations.cs (4)
17private readonly Symbol _symbol; 28private NamespaceOrTypeOrAliasSymbolWithAnnotations(Symbol symbol, bool isNullableEnabled) 37internal Symbol Symbol => _symbol ?? TypeWithAnnotations.Type; 52internal static NamespaceOrTypeOrAliasSymbolWithAnnotations CreateUnannotated(bool isNullableEnabled, Symbol symbol)
Binder\Binder.ValueChecks.cs (18)
32internal Symbol Symbol { get; } 56private MethodInfo(Symbol symbol, MethodSymbol? method, MethodSymbol? setMethod) 595Symbol otherSymbol = null; 630(object)otherSymbol == null ? ImmutableArray<Symbol>.Empty : ImmutableArray.Create(otherSymbol), 1415Symbol containing = this.ContainingMemberOrLambda; 1624private static bool RequiresVariableReceiver(BoundExpression receiver, Symbol symbol) 1728var containing = this.ContainingMemberOrLambda; 1883var containingMember = ContainingMemberOrLambda; 1899private bool IsBadBaseAccess(SyntaxNode node, BoundExpression receiverOpt, Symbol member, BindingDiagnosticBag diagnostics, 1900Symbol propertyOrEventSymbolOpt = null) 2141var symbol = methodInfo.Symbol; 2233var symbol = methodInfo.Symbol; 2501static bool hasRefLikeReturn(Symbol symbol) 2729Symbol symbol, 2741var symbol = argument switch 2790var symbol = methodInfo.Symbol; 3027public override Symbol ContainingSymbol 3259private static void ReportReadOnlyError(Symbol symbol, SyntaxNode node, BindValueKind kind, bool checkingReceiver, BindingDiagnosticBag diagnostics)
Binder\Binder.WithQueryLambdaParametersBinder.cs (1)
88ImmutableArray.Create<Symbol>(receiver.ExpressionSymbol),
Binder\Binder_AnonymousTypes.cs (2)
122foreach (var symbol in anonymousType.GetMembers(field.Name)) 185var member = this.ContainingMemberOrLambda;
Binder\Binder_Attributes.cs (7)
30ImmutableArray<Binder> binders, ImmutableArray<AttributeSyntax> attributesToBind, Symbol ownerSymbol, NamedTypeSymbol[] boundAttributeTypes, 138internal BoundAttribute BindAttribute(AttributeSyntax node, NamedTypeSymbol attributeType, Symbol? attributedMember, BindingDiagnosticBag diagnostics) 155private static BoundAttribute BindAttributeCore(Binder binder, AttributeSyntax node, NamedTypeSymbol attributeType, Symbol? attributedMember, BindingDiagnosticBag diagnostics) 528Symbol namedArgumentNameSymbol = BindNamedAttributeArgumentName(namedArgument, attributeType, diagnostics, out wasError, out resultKind); 592private Symbol BindNamedAttributeArgumentName(AttributeArgumentSyntax namedArgument, NamedTypeSymbol attributeType, BindingDiagnosticBag diagnostics, out bool wasError, out LookupResultKind resultKind) 601Symbol resultSymbol = this.ResultSymbol(result, name, 0, identifierName, diagnostics, false, out wasError, qualifierOpt: null); 607private TypeSymbol BindNamedAttributeArgumentType(AttributeArgumentSyntax namedArgument, Symbol namedArgumentNameSymbol, NamedTypeSymbol attributeType, BindingDiagnosticBag diagnostics)
Binder\Binder_Await.cs (1)
151var containingMemberOrLambda = this.ContainingMemberOrLambda;
Binder\Binder_Constraints.cs (3)
24Symbol containingSymbol, 410Symbol containingSymbol = typeParameter.ContainingSymbol; 446Symbol containingSymbol,
Binder\Binder_Conversions.cs (2)
690foreach (var member in members) 1854foreach (var candidate in builderType.GetMembers(methodName))
Binder\Binder_Crefs.cs (71)
18internal ImmutableArray<Symbol> BindCref(CrefSyntax syntax, out Symbol? ambiguityWinner, BindingDiagnosticBag diagnostics) 20ImmutableArray<Symbol> symbols = BindCrefInternal(syntax, out ambiguityWinner, diagnostics); 26private ImmutableArray<Symbol> BindCrefInternal(CrefSyntax syntax, out Symbol? ambiguityWinner, BindingDiagnosticBag diagnostics) 44private ImmutableArray<Symbol> BindTypeCref(TypeCrefSyntax syntax, out Symbol? ambiguityWinner, BindingDiagnosticBag diagnostics) 60return ImmutableArray.Create<Symbol>(result); 63private ImmutableArray<Symbol> BindQualifiedCref(QualifiedCrefSyntax syntax, out Symbol? ambiguityWinner, BindingDiagnosticBag diagnostics) 99private ImmutableArray<Symbol> BindMemberCref(MemberCrefSyntax syntax, NamespaceOrTypeSymbol? containerOpt, out Symbol? ambiguityWinner, BindingDiagnosticBag diagnostics) 110return ImmutableArray<Symbol>.Empty; 113ImmutableArray<Symbol> result; 142private ImmutableArray<Symbol> BindNameMemberCref(NameMemberCrefSyntax syntax, NamespaceOrTypeSymbol? containerOpt, out Symbol? ambiguityWinner, BindingDiagnosticBag diagnostics) 172return ImmutableArray<Symbol>.Empty; 175ImmutableArray<Symbol> sortedSymbols = ComputeSortedCrefMembers(syntax, containerOpt, memberName, memberNameText, arity, syntax.Parameters != null, diagnostics); 180return ImmutableArray<Symbol>.Empty; 193private ImmutableArray<Symbol> BindIndexerMemberCref(IndexerMemberCrefSyntax syntax, NamespaceOrTypeSymbol? containerOpt, out Symbol? ambiguityWinner, BindingDiagnosticBag diagnostics) 197ImmutableArray<Symbol> sortedSymbols = ComputeSortedCrefMembers(syntax, containerOpt, WellKnownMemberNames.Indexer, memberNameText: WellKnownMemberNames.Indexer, arity, syntax.Parameters != null, diagnostics); 202return ImmutableArray<Symbol>.Empty; 221private ImmutableArray<Symbol> BindOperatorMemberCref(OperatorMemberCrefSyntax syntax, NamespaceOrTypeSymbol? containerOpt, out Symbol? ambiguityWinner, BindingDiagnosticBag diagnostics) 242return ImmutableArray<Symbol>.Empty; 245ImmutableArray<Symbol> sortedSymbols = ComputeSortedCrefMembers(syntax, containerOpt, memberName, memberNameText: memberName, arity, syntax.Parameters != null, diagnostics); 250return ImmutableArray<Symbol>.Empty; 264private ImmutableArray<Symbol> BindConversionOperatorMemberCref(ConversionOperatorMemberCrefSyntax syntax, NamespaceOrTypeSymbol? containerOpt, out Symbol? ambiguityWinner, BindingDiagnosticBag diagnostics) 277return ImmutableArray<Symbol>.Empty; 291ImmutableArray<Symbol> sortedSymbols = ComputeSortedCrefMembers(syntax, containerOpt, memberName, memberNameText: memberName, arity, syntax.Parameters != null, diagnostics); 296return ImmutableArray<Symbol>.Empty; 308return ImmutableArray<Symbol>.Empty; 329private ImmutableArray<Symbol> ComputeSortedCrefMembers(CSharpSyntaxNode syntax, NamespaceOrTypeSymbol? containerOpt, string memberName, string memberNameText, int arity, bool hasParameterList, BindingDiagnosticBag diagnostics) 337private ImmutableArray<Symbol> ComputeSortedCrefMembers(NamespaceOrTypeSymbol? containerOpt, string memberName, string memberNameText, int arity, bool hasParameterList, CSharpSyntaxNode syntax, 342ArrayBuilder<Symbol> builder; 360builder = ArrayBuilder<Symbol>.GetInstance(); 372builder = ArrayBuilder<Symbol>.GetInstance(); 447return ImmutableArray<Symbol>.Empty; 450builder = ArrayBuilder<Symbol>.GetInstance(numInstanceConstructors); 455return ImmutableArray<Symbol>.Empty; 476private ImmutableArray<Symbol> ProcessCrefMemberLookupResults( 477ImmutableArray<Symbol> symbols, 482out Symbol? ambiguityWinner, 492ArrayBuilder<Symbol> candidates = ArrayBuilder<Symbol>.GetInstance(); 496ImmutableArray<Symbol> results = PerformCrefOverloadResolution(candidates, parameterSymbols, arity, memberSyntax, out ambiguityWinner, diagnostics); 627private ImmutableArray<Symbol> ProcessParameterlessCrefMemberLookupResults( 628ImmutableArray<Symbol> symbols, 632out Symbol? ambiguityWinner, 642foreach (Symbol s in symbols) 673Symbol symbol = symbols[0]; 680ArrayBuilder<Symbol> unwrappedSymbols = ArrayBuilder<Symbol>.GetInstance(symbols.Length); 682foreach (Symbol wrapped in symbols) 725return ImmutableArray.Create<Symbol>(ConstructWithCrefTypeParameters(arity, typeArgumentListSyntax, symbol)); 732private void GetCrefOverloadResolutionCandidates(ImmutableArray<Symbol> symbols, int arity, TypeArgumentListSyntax? typeArgumentListSyntax, ArrayBuilder<Symbol> candidates) 734foreach (Symbol candidate in symbols) 736Symbol constructedCandidate = ConstructWithCrefTypeParameters(arity, typeArgumentListSyntax, candidate); 758private static ImmutableArray<Symbol> PerformCrefOverloadResolution(ArrayBuilder<Symbol> candidates, ImmutableArray<ParameterSymbol> parameterSymbols, int arity, MemberCrefSyntax memberSyntax, out Symbol? ambiguityWinner, BindingDiagnosticBag diagnostics) 760ArrayBuilder<Symbol>? viable = null; 762foreach (Symbol candidate in candidates) 770Symbol signatureMember; 834viable = ArrayBuilder<Symbol>.GetInstance(); 861return ImmutableArray<Symbol>.Empty; 881private Symbol ConstructWithCrefTypeParameters(int arity, TypeArgumentListSyntax? typeArgumentListSyntax, Symbol symbol)
Binder\Binder_Deconstruct.cs (1)
639var variableSymbol = variableOpt switch
Binder\Binder_Expressions.cs (77)
37var memberOpt = this.ContainingMemberOrLambda?.ContainingNonLambdaMember(); 108return BadExpression(syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty); 116return BadExpression(syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, childNode); 124return BadExpression(syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, childNodes); 132return BadExpression(syntax, lookupResultKind, ImmutableArray<Symbol>.Empty); 140return BadExpression(syntax, lookupResultKind, ImmutableArray<Symbol>.Empty, childNode); 146private BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols) 159private BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols, BoundExpression childNode) 172private BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols, ImmutableArray<BoundExpression> childNodes, bool wasCompilerGenerated = false) 214ArrayBuilder<Symbol> symbols = ArrayBuilder<Symbol>.GetInstance(); 315if (op.NoCommonTypeError == ErrorCode.ERR_InvalidQM && trueArg is Symbol trueSymbol && falseArg is Symbol falseSymbol) 854node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(BindToTypeForErrorRecovery(BindValue(node.Expression, BindingDiagnosticBag.Discarded, BindValueKind.RefersToLocation))), 1041argumentSyntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, 1325Symbol container = this.ContainingMemberOrLambda; 1604var members = ArrayBuilder<Symbol>.GetInstance(); 1605Symbol symbol = GetSymbolOrMethodOrPropertyGroup(lookupResult, node, name, node.Arity, members, diagnostics, out isError, qualifierOpt: null); // reports diagnostics in result. 1728void reportPrimaryConstructorParameterShadowing(SimpleNameSyntax node, Symbol symbol, string name, bool invoked, LookupResult lookupResult, ArrayBuilder<Symbol> members, BindingDiagnosticBag diagnostics) 1840private BoundExpression SynthesizeMethodGroupReceiver(CSharpSyntaxNode syntax, ArrayBuilder<Symbol> members) 1933private bool IsBadLocalOrParameterCapture(Symbol symbol, TypeSymbol type, RefKind refKind) 1950private BoundExpression BindNonMethod(SimpleNameSyntax node, Symbol symbol, BindingDiagnosticBag diagnostics, LookupResultKind resultKind, bool indexed, bool isError) 2228private bool ReportSimpleProgramLocalReferencedOutsideOfTopLevelStatement(SimpleNameSyntax node, Symbol symbol, BindingDiagnosticBag diagnostics) 2245private BoundExpression SynthesizeReceiver(SyntaxNode node, Symbol member, BindingDiagnosticBag diagnostics) 2281var containingMember = ContainingMember(); 2316internal Symbol ContainingMember() 2346var containingMember = this.ContainingMemberOrLambda; 2425var symbol = this.BindNamespaceAliasSymbol(node, diagnostics); 2429private static BoundExpression CreateBoundNamespaceOrTypeExpression(ExpressionSyntax node, Symbol symbol) 3245internal static void CheckRestrictedTypeInAsyncMethod(Symbol containingSymbol, TypeSymbol type, BindingDiagnosticBag diagnostics, SyntaxNode syntax) 3262foreach (Symbol member in ContainingType?.GetMembers(identifier) ?? ImmutableArray<Symbol>.Empty) 3383where TMember : Symbol 4454ImmutableArray<Symbol>.Empty, 4493ImmutableArray<Symbol>.Empty, 4825symbols: ImmutableArray<Symbol>.Empty, 4836symbols: ImmutableArray<Symbol>.Empty, //CONSIDER: we could look for a matching constructor on System.ValueType 4879symbols: ImmutableArray<Symbol>.Empty, //CONSIDER: we could look for a matching constructor on System.ValueType 5200return new BoundBadExpression(syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType()); 5409return new BoundBadExpression(node, LookupResultKind.NotInvocable, StaticCast<Symbol>.From(type.InstanceConstructors), ImmutableArray.Create(argument), type); 5456return new BoundBadExpression(node, LookupResultKind.OverloadResolutionFailure, StaticCast<Symbol>.From(type.InstanceConstructors), childNodes, type); 5553return new BoundBadExpression(node, LookupResultKind.NotCreatable, ImmutableArray.Create<Symbol?>(type), children.ToImmutableAndFree(), type) { WasCompilerGenerated = wasCompilerGenerated }; 6082private static ImmutableSegmentedDictionary<string, Symbol> GetMembersRequiringInitialization(MethodSymbol constructor) 6087return ImmutableSegmentedDictionary<string, Symbol>.Empty; 6099ImmutableSegmentedDictionary<string, Symbol> requiredMembers = GetMembersRequiringInitialization(constructor); 6121var memberSymbol = assignmentOperator.Left switch 6159private static void ReportMembersRequiringInitialization(SyntaxNode creationSyntax, ImmutableSegmentedDictionary<string, Symbol>.Builder requiredMembersBuilder, BindingDiagnosticBag diagnostics) 6389return BadExpression(elementInitializer, LookupResultKind.NotInvocable, ImmutableArray<Symbol>.Empty, boundElementInitializerExpressions); 6840ArrayBuilder<Symbol> symbols = ArrayBuilder<Symbol>.GetInstance(); 7020return new BoundBadExpression(node, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol>.Empty, children, interfaceType); 7450Symbol leftSymbol; 7771ArrayBuilder<Symbol> symbols = lookupResult.Symbols; 7776Symbol sym = ResultSymbol(lookupResult, rightName, rightArity, node, diagnostics, false, out wasError, ns, options); 8052ReportQueryLookupFailed(node, boundLeft, plainName, ImmutableArray<Symbol>.Empty, diagnostics); 8115return this.BindMemberAccessBadResult(syntax, node.Name, node.ReceiverOpt, node.LookupError, StaticCast<Symbol>.From(node.Methods), node.ResultKind); 8126ImmutableArray<Symbol> symbols, 8132foreach (var s in symbols) 8158var symbolOpt = symbols.Length == 1 ? symbols[0] : null; 8162(object)symbolOpt == null ? ImmutableArray<Symbol>.Empty : ImmutableArray.Create(symbolOpt), 8167private TypeSymbol GetNonMethodMemberType(Symbol symbolOpt) 8238var members = ArrayBuilder<Symbol>.GetInstance(); 8241Symbol symbol = GetSymbolOrMethodOrPropertyGroup(lookupResult, right, plainName, arity, members, diagnostics, out wasError, 8486var members = ArrayBuilder<Symbol>.GetInstance(); 8488Symbol symbol = GetSymbolOrMethodOrPropertyGroup(lookupResult, node, rightName, arity, members, diagnostics, out wasError, qualifierOpt: null); 8694private void CheckReceiverAndRuntimeSupportForSymbolAccess(SyntaxNode node, BoundExpression receiverOpt, Symbol symbol, BindingDiagnosticBag diagnostics) 8746static bool isNotImplementableInstanceMember(Symbol symbol) 8802Symbol symbol, 8850private Symbol GetSymbolOrMethodOrPropertyGroup(LookupResult result, SyntaxNode node, string plainName, int arity, ArrayBuilder<Symbol> methodOrPropertyGroup, BindingDiagnosticBag diagnostics, out bool wasError, NamespaceOrTypeSymbol qualifierOpt) 8860Symbol other = null; // different member type from 'methodOrPropertyGroup' 8932private static bool IsMethodOrPropertyGroup(ArrayBuilder<Symbol> members) 9270return new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, childBoundNodes, CreateErrorType(), hasErrors: true); 9616foreach (Symbol symbol in lookupResult.Symbols) 10936return Symbol.ReportUseSiteDiagnostic(diagnosticInfo, diagnostics, getErrorLocation()); 11034internal static bool MethodOrLambdaRequiresValue(Symbol symbol, CSharpCompilation compilation)
Binder\Binder_Flags.cs (6)
18private readonly Symbol _containingMemberOrLambda; 20internal BinderWithContainingMemberOrLambda(Binder next, Symbol containingMemberOrLambda) 28internal BinderWithContainingMemberOrLambda(Binder next, BinderFlags flags, Symbol containingMemberOrLambda) 36internal override Symbol ContainingMemberOrLambda 78internal Binder WithContainingMemberOrLambda(Symbol containing) 88internal Binder WithAdditionalFlagsAndContainingMemberOrLambda(BinderFlags flags, Symbol containing)
Binder\Binder_Invocation.cs (8)
111Symbol symbol; 678where TMember : Symbol 857where TMethodOrPropertySymbol : Symbol 976BindingDiagnosticBag diagnostics) where TMethodOrPropertySymbol : Symbol 1474Symbol? attributedMember = null) 1525var containingMember = InAttributeArgument ? attributedMember : ContainingMember() switch 1597BoundExpression bindDefaultArgument(SyntaxNode syntax, ParameterSymbol parameter, Symbol? containingMember, bool enableCallerInfo, BindingDiagnosticBag diagnostics, ArrayBuilder<BoundExpression> argumentsBuilder, int argumentsCount, ImmutableArray<int> argsToParamsOpt) 2185where TMember : Symbol
Binder\Binder_Lookup.cs (46)
302Symbol existingDefinition = submissionSymbols.Symbols.First(); 336Symbol firstSymbol = submissionSymbols.Symbols.First(); 447foreach (Symbol member in members) 521Symbol symbolWithoutSuffix; 527Symbol symbolWithSuffix = null; 587private bool IsAmbiguousResult(LookupResult result, out Symbol resultSymbol) 613private Symbol ResolveMultipleSymbolsInAttributeTypeLookup(ArrayBuilder<Symbol> symbols) 645private static bool NameAndArityMatchRecursively(Symbol x, Symbol y) 665static bool isRoot(Symbol symbol) => symbol is null || symbol is NamespaceSymbol { IsGlobalNamespace: true }; 668private bool IsSingleViableAttributeType(LookupResult result, out Symbol symbol, ref CompoundUseSiteInfo<AssemblySymbol> attributeTypeViabilityUseSiteInfo) 684private SingleLookupResult GenerateNonViableAttributeTypeResult(Symbol symbol, DiagnosticInfo diagInfo, bool diagnose) 694private bool CheckAttributeTypeViability(Symbol symbol, bool diagnose, ref DiagnosticInfo diagInfo, ref CompoundUseSiteInfo<AssemblySymbol> attributeTypeViabilityUseSiteInfo) 768foreach (Symbol member in members) 838var other = GetNearestOtherSymbol(basesBeingResolved, type); 893var allMembers = new HashSet<Symbol>(comparer); 894var conflictingMembers = new HashSet<Symbol>(comparer); 947foreach (var sym in allMembers) 988private static Symbol GetNearestOtherSymbol(ConsList<TypeSymbol> list, TypeSymbol type) 1288private static bool IsMethodOrIndexer(Symbol symbol) 1293internal static ImmutableArray<Symbol> GetCandidateMembers(NamespaceOrTypeSymbol nsOrType, string name, LookupOptions options, Binder originalBinder) 1297return nsOrType.GetTypeMembers(name).Cast<NamedTypeSymbol, Symbol>(); 1305return ImmutableArray<Symbol>.Empty; 1317internal static ImmutableArray<Symbol> GetCandidateMembers(NamespaceOrTypeSymbol nsOrType, LookupOptions options, Binder originalBinder) 1321return StaticCast<Symbol>.From(nsOrType.GetTypeMembersUnordered()); 1329return ImmutableArray<Symbol>.Empty; 1337private bool IsInScopeOfAssociatedSyntaxTree(Symbol symbol) 1385internal SingleLookupResult CheckViability(Symbol symbol, int arity, LookupOptions options, TypeSymbol accessThroughType, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved = null) 1441var unwrappedSymbols = ImmutableArray.Create<Symbol>(unwrappedSymbol); 1466diagInfo = new CSDiagnosticInfo(ErrorCode.ERR_BadAccess, new[] { unwrappedSymbol }, ImmutableArray.Create<Symbol>(unwrappedSymbol), additionalLocations: ImmutableArray<Location>.Empty); 1540private CSDiagnosticInfo MakeCallMethodsDirectlyDiagnostic(Symbol symbol) 1577/// Does not consider <see cref="Symbol.CanBeReferencedByName"/> - that is left to the caller. 1579internal bool CanAddLookupSymbolInfo(Symbol symbol, LookupOptions options, LookupSymbolsInfo info, TypeSymbol accessThroughType, AliasSymbol aliasSymbol = null) 1645private bool IsCrefAccessible(Symbol symbol) 1650private static bool IsEffectivelyPrivate(Symbol symbol) 1652for (Symbol s = symbol; (object)s != null; s = s.ContainingSymbol) 1667internal bool IsAccessible(Symbol symbol, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, TypeSymbol accessThroughType = null, ConsList<TypeSymbol> basesBeingResolved = null) 1673internal bool IsAccessible(Symbol symbol, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 1686internal bool IsAccessible(Symbol symbol, TypeSymbol accessThroughType, out bool failedThroughTypeCheck, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved = null) 1698/// Should only be called by <see cref="IsAccessible(Symbol, TypeSymbol, out bool, ref CompoundUseSiteInfo{AssemblySymbol}, ConsList{TypeSymbol})"/>, 1701internal virtual bool IsAccessibleHelper(Symbol symbol, TypeSymbol accessThroughType, out bool failedThroughTypeCheck, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved) 1707internal bool IsNonInvocableMember(Symbol symbol) 1723private bool IsInvocableMember(Symbol symbol) 1748private static bool IsInstance(Symbol symbol) 1765private static bool WrongArity(Symbol symbol, int arity, bool diagnose, LookupOptions options, out DiagnosticInfo diagInfo)
Binder\Binder_NameConflicts.cs (4)
18internal bool ValidateDeclarationNameConflictsInScope(Symbol symbol, BindingDiagnosticBag diagnostics) 24private static Location GetLocation(Symbol symbol) 93private bool ValidateNameConflictsInScope(Symbol? symbol, Location location, string name, BindingDiagnosticBag diagnostics) 134var containingMemberOrLambda = this.ContainingMemberOrLambda;
Binder\Binder_Operators.cs (2)
2562internal bool IsMoveableVariable(BoundExpression expr, out Symbol accessedLocalOrParameterOpt) 3276diagnostics.Add(ErrorCode.WRN_IsTypeNamedUnderscore, node.Right.Location, typeExpression.AliasOpt ?? (Symbol)targetType);
Binder\Binder_Patterns.cs (10)
334out Symbol? variableSymbol, out BoundExpression? variableAccess); 370lengthAccess = new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType(), hasErrors: true) { WasCompilerGenerated = true }; 847hasErrors: ref hasErrors, variableSymbol: out Symbol? variableSymbol, variableAccess: out BoundExpression? variableAccess); 872out Symbol? variableSymbol, 1034ref hasErrors, out Symbol? variableSymbol, out BoundExpression? variableAccess); 1299foreach (var symbol in tupleType.GetMembers(name)) 1331Symbol foundSymbol = BindTypeOrAliasOrKeyword(node.VarKeyword, node, diagnostics, out bool isVar).Symbol; 1361variableSymbol: out Symbol? variableSymbol, variableAccess: out BoundExpression? variableAccess); 1513Symbol? symbol = null; 1539private Symbol? BindPropertyPatternMember(
Binder\Binder_Query.cs (6)
302state.selectOrGroup, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol?>.Empty, 736yExpression = new BoundBadExpression(yExpression.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(yExpression), CreateErrorType()); 742yExpression = new BoundBadExpression(yExpression.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(yExpression), yExpression.Type); 803field2Value = new BoundBadExpression(field2Value.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(field2Value), field2Value.Type, true); 975receiver = new BoundBadExpression(receiver.Syntax, LookupResultKind.NotAValue, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(receiver), CreateErrorType()); 997receiver = new BoundBadExpression(receiver.Syntax, LookupResultKind.NotAValue, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(receiver), CreateErrorType());
Binder\Binder_QueryErrors.cs (3)
29ImmutableArray<Symbol> symbols, 164internal static void ReportQueryInferenceFailed(CSharpSyntaxNode queryClause, string methodName, BoundExpression receiver, AnalyzedArguments arguments, ImmutableArray<Symbol> symbols, BindingDiagnosticBag diagnostics) 213private static bool ReportQueryInferenceFailedSelectMany(FromClauseSyntax fromClause, string methodName, BoundExpression receiver, AnalyzedArguments arguments, ImmutableArray<Symbol> symbols, BindingDiagnosticBag diagnostics)
Binder\Binder_Statements.cs (10)
32internal virtual ImmutableHashSet<Symbol> LockedOrDisposedVariables 595Symbol.CheckForBlockAndExpressionBody( 1702internal static Symbol? GetIndexerOrImplicitIndexerSymbol(BoundExpression? e) 1757internal static bool AccessingAutoPropertyFromConstructor(BoundPropertyAccess propertyAccess, Symbol fromMember) 1762private static bool AccessingAutoPropertyFromConstructor(BoundExpression? receiver, PropertySymbol propertySymbol, Symbol fromMember, AccessorKind accessorKind) 1795private static bool IsConstructorOrField(Symbol member, bool isStatic) 2944var symbol = this.ContainingMemberOrLambda; 2950var symbol = this.ContainingMemberOrLambda; 2956var symbol = this.ContainingMemberOrLambda; 3058var container = this.ContainingMemberOrLambda;
Binder\Binder_Symbols.cs (46)
196Symbol symbol = null; 348private NamespaceOrTypeSymbol GetContainingNamespaceOrType(Symbol symbol) 353internal Symbol BindNamespaceAliasSymbol(IdentifierNameSyntax node, BindingDiagnosticBag diagnostics) 368Symbol bindingResult = ResultSymbol(result, plainName, 0, node, diagnostics, false, out wasError, qualifierOpt: null, options: LookupOptions.NamespaceAliasesOnly); 579var bindingResult = BindNamespaceAliasSymbol(node.Alias, diagnostics); 878Symbol bindingResult = null; 1051Symbol.ReportUseSiteDiagnostic(info, diagnostics, node.Location); 1084private static Symbol UnwrapAliasNoDiagnostics(Symbol symbol, ConsList<TypeSymbol> basesBeingResolved = null) 1116private Symbol UnwrapAlias(Symbol symbol, BindingDiagnosticBag diagnostics, SyntaxNode syntax, ConsList<TypeSymbol> basesBeingResolved = null) 1122private Symbol UnwrapAlias(Symbol symbol, out AliasSymbol alias, BindingDiagnosticBag diagnostics, SyntaxNode syntax, ConsList<TypeSymbol> basesBeingResolved = null) 1280Symbol lookupResultSymbol = ResultSymbol(lookupResult, plainName, arity, node, diagnostics, (basesBeingResolved != null), out wasError, qualifierOpt, options); 1309ImmutableArray.Create<Symbol>(lookupResultSymbol), 1421ArrayBuilder<Symbol> members, 1469receiver = new BoundBadExpression(receiver.Syntax, LookupResultKind.Ambiguous, ImmutableArray<Symbol>.Empty, ImmutableArray.Create(receiver), receiver.Type, hasErrors: true).MakeCompilerGenerated(); 1523ArrayBuilder<Symbol> members, TypeSymbol receiverType, 1565private static readonly Func<Symbol, MethodSymbol> s_toMethodSymbolFunc = s => (MethodSymbol)s; 1566private static readonly Func<Symbol, PropertySymbol> s_toPropertySymbolFunc = s => (PropertySymbol)s; 1674internal Symbol GetSpecialTypeMember(SpecialMember member, BindingDiagnosticBag diagnostics, SyntaxNode syntax) 1679internal static Symbol GetSpecialTypeMember(CSharpCompilation compilation, SpecialMember member, BindingDiagnosticBag diagnostics, SyntaxNode syntax) 1681Symbol memberSymbol; 1688where TSymbol : Symbol 1728private static UseSiteInfo<AssemblySymbol> GetUseSiteInfoForWellKnownMemberOrContainingType(Symbol symbol) 1743internal static bool ReportUseSite(Symbol symbol, BindingDiagnosticBag diagnostics, SyntaxNode node) 1748internal static bool ReportUseSite(Symbol symbol, BindingDiagnosticBag diagnostics, SyntaxToken token) 1759internal static bool ReportUseSite(Symbol symbol, BindingDiagnosticBag diagnostics, Location location) 1811internal Symbol GetWellKnownTypeMember(WellKnownMember member, BindingDiagnosticBag diagnostics, Location location = null, SyntaxNode syntax = null, bool isOptional = false) 1820internal static Symbol GetWellKnownTypeMember(CSharpCompilation compilation, WellKnownMember member, BindingDiagnosticBag diagnostics, Location location = null, SyntaxNode syntax = null, bool isOptional = false) 1825Symbol memberSymbol = GetWellKnownTypeMember(compilation, member, out useSiteInfo, isOptional); 1834internal static Symbol GetWellKnownTypeMember(CSharpCompilation compilation, WellKnownMember member, out UseSiteInfo<AssemblySymbol> useSiteInfo, bool isOptional = false) 1836Symbol memberSymbol = compilation.GetWellKnownTypeMember(member); 1877private class ConsistentSymbolOrder : IComparer<Symbol> 1880public int Compare(Symbol fst, Symbol snd) 1902internal Symbol ResultSymbol( 1913Symbol symbol = resultSymbol(result, simpleName, arity, where, diagnostics, suppressUseSiteDiagnostics, out wasError, qualifierOpt, options); 1931Symbol resultSymbol( 2032Debug.Assert(!Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything) || options.IsAttributeTypeLookup(), 2035Debug.Assert(!Symbol.Equals(first, second, TypeCompareKind.ConsiderEverything) || !Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything), 2191!Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything), 2354private static AssemblySymbol GetContainingAssembly(Symbol symbol) 2474private BestSymbolInfo GetBestSymbolInfo(ArrayBuilder<Symbol> symbols, out BestSymbolInfo secondBest) 2520private static BestSymbolLocation GetLocation(CSharpCompilation compilation, Symbol symbol)
Binder\Binder_XmlNameAttribute.cs (5)
19internal ImmutableArray<Symbol> BindXmlNameAttribute(XmlNameAttributeSyntax syntax, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 25return ImmutableArray<Symbol>.Empty; 36return ImmutableArray<Symbol>.Empty; 43ArrayBuilder<Symbol> lookupSymbols = lookupResult.Symbols; 49ImmutableArray<Symbol> result = lookupSymbols.ToImmutable();
Binder\BinderFactory.BinderFactoryVisitor.cs (11)
24private Symbol _memberOpt; 27internal void Initialize(BinderFactory factory, int position, CSharpSyntaxNode memberDeclarationOpt, Symbol memberOpt) 436Symbol containingSymbol = binder.ContainingMemberOrLambda; 560private Symbol GetMemberSymbol(string memberName, TextSpan memberSpan, NamedTypeSymbol container, SymbolKind kind) 566foreach (Symbol sym in sourceMemberContainerTypeSymbol.GetMembersToMatchAgainstDeclarationSpan()) 573if (sym.Name == memberName && checkSymbol(sym, memberSpan, kind, out Symbol result)) 581foreach (Symbol sym in container.GetMembers(memberName)) 583if (checkSymbol(sym, memberSpan, kind, out Symbol result)) 592bool checkSymbol(Symbol sym, TextSpan memberSpan, SymbolKind kind, out Symbol result) 614MethodSymbol method => (Symbol)method.PartialImplementationPart,
Binder\BinderFactory.cs (3)
109internal Binder GetBinder(SyntaxNode node, CSharpSyntaxNode memberDeclarationOpt = null, Symbol memberOpt = null) 124internal Binder GetBinder(SyntaxNode node, int position, CSharpSyntaxNode memberDeclarationOpt = null, Symbol memberOpt = null) 141private BinderFactoryVisitor GetBinderFactoryVisitor(int position, CSharpSyntaxNode memberDeclarationOpt, Symbol memberOpt)
Binder\BindingDiagnosticBag.cs (7)
87internal void AddDependencies(Symbol? symbol) 95internal bool ReportUseSite(Symbol? symbol, SyntaxNode node) 100internal bool ReportUseSite(Symbol? symbol, SyntaxToken token) 105internal bool ReportUseSite(Symbol? symbol, Location location) 108internal bool ReportUseSite<TData>(Symbol? symbol, Func<TData, Location> getLocation, TData data) 151return Symbol.ReportUseSiteDiagnostic(diagnosticInfo, diagnosticBag, location); 174internal CSDiagnosticInfo Add(ErrorCode code, Location location, ImmutableArray<Symbol> symbols, params object[] args)
Binder\BuckStopsHereBinder.cs (4)
67internal override bool IsAccessibleHelper(Symbol symbol, TypeSymbol accessThroughType, out bool failedThroughTypeCheck, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved) 158internal override Symbol? ContainingMemberOrLambda 252internal override ImmutableHashSet<Symbol> LockedOrDisposedVariables 254get { return ImmutableHashSet.Create<Symbol>(); }
Binder\ContextualAttributeBinder.cs (7)
20private readonly Symbol _attributeTarget; 21private readonly Symbol _attributedMember; 25public ContextualAttributeBinder(Binder enclosing, Symbol symbol) 41internal Symbol AttributedMember 52internal static Symbol GetAttributedMember(Symbol symbol) 68internal Symbol AttributeTarget
Binder\DecisionDagBuilder.cs (1)
363private BoundDagTemp OriginalInput(BoundDagTemp input, Symbol symbol)
Binder\ExecutableCodeBinder.cs (5)
27private readonly Symbol _memberSymbol; 32internal ExecutableCodeBinder(SyntaxNode root, Symbol memberSymbol, Binder next, Action<Binder, SyntaxNode> binderUpdatedHandler = null) 38internal ExecutableCodeBinder(SyntaxNode root, Symbol memberSymbol, Binder next, BinderFlags additionalFlags) 48internal override Symbol ContainingMemberOrLambda 56internal Symbol MemberSymbol { get { return _memberSymbol; } }
Binder\ExpressionVariableFinder.cs (6)
18internal abstract class ExpressionVariableFinder<TFieldOrLocalSymbol> : CSharpSyntaxWalker where TFieldOrLocalSymbol : Symbol 674internal class ExpressionFieldFinder : ExpressionVariableFinder<Symbol> 681ArrayBuilder<Symbol> builder, 705protected override Symbol MakePatternVariable(TypeSyntax type, SingleVariableDesignationSyntax designation, SyntaxNode nodeToBind) 713protected override Symbol MakeDeclarationExpressionVariable(DeclarationExpressionSyntax node, SingleVariableDesignationSyntax designation, BaseArgumentListSyntax argumentListSyntaxOpt, SyntaxNode nodeToBind) 721protected override Symbol MakeDeconstructionVariable(
Binder\ForEachLoopBinder.cs (4)
725ImmutableArray<Symbol>.Empty, 1380foreach (Symbol member in lookupResult.Symbols) 1646Symbol lookupSymbol = lookupResult.SingleSymbolOrDefault; 1710private void ReportEnumerableWarning(SyntaxNode collectionSyntax, BindingDiagnosticBag diagnostics, TypeSymbol enumeratorType, Symbol patternMemberCandidate)
Binder\HostObjectModeBinder.cs (1)
42ImmutableArray<Symbol>.Empty,
Binder\InContainerBinder.cs (2)
43internal override Symbol ContainingMemberOrLambda 57internal override bool IsAccessibleHelper(Symbol symbol, TypeSymbol accessThroughType, out bool failedThroughTypeCheck, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved)
Binder\InMethodBinder.cs (10)
26private SmallDictionary<string, Symbol> _lazyDefinitionMap; 48private static void RecordDefinition<T>(SmallDictionary<string, Symbol> declarationMap, ImmutableArray<T> definitions) where T : Symbol 50foreach (Symbol s in definitions) 71internal override Symbol ContainingMemberOrLambda 242private static bool ReportConflictWithParameter(Symbol parameter, Symbol newSymbol, string name, Location newLocation, BindingDiagnosticBag diagnostics) 322internal override bool EnsureSingleDefinition(Symbol symbol, string name, Location location, BindingDiagnosticBag diagnostics) 336map = new SmallDictionary<string, Symbol>(); 343Symbol existingDeclaration;
Binder\LocalBinderFactory.cs (8)
36private Symbol _containingMemberOrLambda; 73Symbol containingMemberOrLambda, 135private LocalBinderFactory(Symbol containingMemberOrLambda, SyntaxNode root, Binder enclosing) 224var attributeTarget = getAttributeTarget(_enclosing); 287static Symbol getAttributeTarget(Binder current) 296static WithTypeParametersBinder? getExtraWithTypeParametersBinder(Binder enclosing, Symbol target) 301static Binder? getExtraWithParametersBinder(Binder enclosing, Symbol target) 407Symbol oldMethod = _containingMemberOrLambda;
Binder\LocalScopeBinder.cs (6)
132where TSymbol : Symbol 501private bool ReportConflictWithLocal(Symbol local, Symbol newSymbol, string name, Location newLocation, BindingDiagnosticBag diagnostics) 541internal virtual bool EnsureSingleDefinition(Symbol symbol, string name, Location location, BindingDiagnosticBag diagnostics) 553var existingSymbol = (Symbol)existingLocal ?? existingLocalFunction;
Binder\LockBinder.cs (1)
114foreach (var member in members)
Binder\LockOrUsingBinder.cs (3)
21private ImmutableHashSet<Symbol> _lazyLockedOrDisposedVariables; 31internal sealed override ImmutableHashSet<Symbol> LockedOrDisposedVariables 37ImmutableHashSet<Symbol> lockedOrDisposedVariables = this.Next.LockedOrDisposedVariables;
Binder\LookupResult.cs (17)
17internal delegate SingleLookupResult LookupFilter(Symbol sym); 68private readonly ArrayBuilder<Symbol> _symbolList; 79_symbolList = new ArrayBuilder<Symbol>(); 109internal Symbol SingleSymbolOrDefault 117internal ArrayBuilder<Symbol> Symbols 155internal static SingleLookupResult Good(Symbol symbol) 160internal static SingleLookupResult WrongArity(Symbol symbol, DiagnosticInfo error) 170internal static SingleLookupResult NotReferencable(Symbol symbol, DiagnosticInfo error) 175internal static SingleLookupResult StaticInstanceMismatch(Symbol symbol, DiagnosticInfo error) 180internal static SingleLookupResult Inaccessible(Symbol symbol, DiagnosticInfo error) 185internal static SingleLookupResult NotInvocable(Symbol unwrappedSymbol, Symbol symbol, bool diagnose) 191internal static SingleLookupResult NotLabel(Symbol symbol, DiagnosticInfo error) 196internal static SingleLookupResult NotTypeOrNamespace(Symbol symbol, DiagnosticInfo error) 201internal static SingleLookupResult NotTypeOrNamespace(Symbol unwrappedSymbol, Symbol symbol, bool diagnose) 208internal static SingleLookupResult NotAnAttributeType(Symbol symbol, DiagnosticInfo error)
Binder\LookupSymbolsInfo.cs (1)
14internal sealed class LookupSymbolsInfo : AbstractLookupSymbolsInfo<Symbol>
Binder\MethodGroupResolution.cs (3)
21public readonly Symbol OtherSymbol; 32public MethodGroupResolution(Symbol otherSymbol, LookupResultKind resultKind, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics) 39Symbol otherSymbol,
Binder\PatternExplainer.cs (2)
533var properties = new Dictionary<Symbol, string>(); 651foreach (var declaredMember in e.GetMembers())
Binder\RefSafetyAnalysis.cs (2)
36private static bool InUnsafeMethod(Symbol symbol) 596static SafeContext getPositionalValEscape(Symbol? symbol, SafeContext valEscape)
Binder\ScriptLocalScopeBinder.cs (1)
24internal override Symbol ContainingMemberOrLambda
Binder\Semantics\AccessCheck.cs (11)
25Symbol symbol, 38Symbol symbol, 53Symbol symbol, 67internal static bool IsEffectivelyPublicOrInternal(Symbol symbol, out bool isInternal) 134Symbol symbol, 135Symbol within, // must be assembly or named type symbol 223private static bool IsNamedTypeAccessible(NamedTypeSymbol type, Symbol within, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved = null) 259Symbol within) 300Symbol within, 344Symbol within, 493Symbol within,
Binder\Semantics\OverloadResolution\IMemberResolutionResultWithPriority.cs (1)
11internal interface IMemberResolutionResultWithPriority<TMember> where TMember : Symbol
Binder\Semantics\OverloadResolution\MemberAnalysisResult.cs (1)
213internal bool HasUseSiteDiagnosticToReportFor(Symbol symbol)
Binder\Semantics\OverloadResolution\MemberResolutionResult.cs (1)
15internal readonly struct MemberResolutionResult<TMember> : IMemberResolutionResultWithPriority<TMember> where TMember : Symbol
Binder\Semantics\OverloadResolution\MethodGroup.cs (1)
43ArrayBuilder<Symbol> members,
Binder\Semantics\OverloadResolution\OverloadResolution.cs (60)
66where TMember : Symbol 80where TMember : Symbol 195where TMember : Symbol 320where TMember : Symbol 359where TMember : Symbol 439where TMember : Symbol 491private static readonly ObjectPool<PooledHashSet<Symbol>> s_HiddenSymbolsSetPool = PooledHashSet<Symbol>.CreatePool(Microsoft.CodeAnalysis.CSharp.Symbols.SymbolEqualityComparer.AllIgnoreOptions); 494where TMember : Symbol 496PooledHashSet<Symbol> hiddenSymbols = null; 507foreach (Symbol hidden in getHiddenMembers(result.LeastOverriddenMember.ConstructedFrom())) 539static ImmutableArray<Symbol> getHiddenMembers(Symbol member) 550return ImmutableArray<Symbol>.Empty; 582BoundExpression receiverOpt) where TMember : Symbol 609private static void RemoveStaticInstanceMismatches<TMember>(ArrayBuilder<MemberResolutionResult<TMember>> results, bool requireStatic) where TMember : Symbol 622private static void RemoveMethodsNotDeclaredStatic<TMember>(ArrayBuilder<MemberResolutionResult<TMember>> results) where TMember : Symbol 638private void RemoveConstraintViolations<TMember>(ArrayBuilder<MemberResolutionResult<TMember>> results, CompoundUseSiteInfo<AssemblySymbol> template) where TMember : Symbol 652var member = (MethodSymbol)(Symbol)result.Member; 665private void RemoveCallingConventionMismatches<TMember>(ArrayBuilder<MemberResolutionResult<TMember>> results, in CallingConventionInfo expectedConvention) where TMember : Symbol 688var member = (MethodSymbol)(Symbol)result.Member; 841bool isFunctionPointerConversion) where TMember : Symbol 857var method = (MethodSymbol)(Symbol)result.Member; 889private static Dictionary<NamedTypeSymbol, ArrayBuilder<TMember>> PartitionMembersByContainingType<TMember>(ArrayBuilder<TMember> members) where TMember : Symbol 907private static void ClearContainingTypeMap<TMember>(ref Dictionary<NamedTypeSymbol, ArrayBuilder<TMember>> containingTypeMapOpt) where TMember : Symbol 1056where TMember : Symbol 1224where TMember : Symbol 1285public static bool IsValidParams(Binder binder, Symbol member, bool disallowExpandedNonArrayParams, out TypeWithAnnotations definitionElementType) 1369Symbol member, 1370Symbol moreDerivedOverride, 1402where TMember : Symbol 1426where TMember : Symbol 1446private static bool HidesByName(Symbol member) 1460where TMember : Symbol 1482where TMember : Symbol 1605where TMember : Symbol 1648where TMember : Symbol 1766where TMember : Symbol 1775where TMember : Symbol 1836where TMember : Symbol 1923where TMember : Symbol 2083where TMember : Symbol 2123where TMember : Symbol 2583where TMember : Symbol 2607where TMember : Symbol 2666private static void GetParameterCounts<TMember>(MemberResolutionResult<TMember> m, ArrayBuilder<BoundExpression> arguments, out int declaredParameterCount, out int parametersUsedIncludingExpansionAndOptional) where TMember : Symbol 3820out bool hasAnyRefOmittedArgument) where TMember : Symbol 3959Options options) where TMember : Symbol 3972out bool hasAnyRefOmittedArgument) where TMember : Symbol 4030where TMember : Symbol 4111where TMember : Symbol 4179where TMember : Symbol 4188member.Kind == SymbolKind.Method && (method = (MethodSymbol)(Symbol)member).Arity > 0) 4190MethodSymbol leastOverriddenMethod = (MethodSymbol)(Symbol)leastOverriddenMember; 4231member = (TMember)(Symbol)method.Construct(typeArguments); 4232leastOverriddenMember = (TMember)(Symbol)leastOverriddenMethod.ConstructedFrom.Construct(typeArguments); 4360Symbol candidate, // method or property 4559Symbol candidate, // method or property 4635private static TMember GetConstructedFrom<TMember>(TMember member) where TMember : Symbol 4642return (TMember)(Symbol)(member as MethodSymbol).ConstructedFrom;
Binder\Semantics\OverloadResolution\OverloadResolution_ArgsToParameters.cs (1)
59Symbol symbol,
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (25)
26internal class OverloadResolutionResult<TMember> where TMember : Symbol 204bool isParamsModifierValidation = false) where T : Symbol 215var symbols = StaticCast<Symbol>.From(memberGroup); 580private static void ReportUnsupportedMetadata(Location location, BindingDiagnosticBag diagnostics, ImmutableArray<Symbol> symbols, MemberResolutionResult<TMember> firstUnsupported) 592Symbol.ReportUseSiteDiagnostic(diagInfo, diagnostics, location); 595private static void ReportWrongCallingConvention(Location location, BindingDiagnosticBag diagnostics, ImmutableArray<Symbol> symbols, MemberResolutionResult<TMember> firstSupported, MethodSymbol target) 622ImmutableArray<Symbol> symbols, 641ImmutableArray<Symbol> symbols, 656Symbol symbol = staticInstanceMismatch.Member; 710var method = (MethodSymbol)(Symbol)mismatch.Member; 740ImmutableArray<Symbol> symbols, 793ImmutableArray<Symbol> symbols) 813ImmutableArray<Symbol> symbols) 846ImmutableArray<Symbol> symbols) 881ImmutableArray<Symbol> symbols, 926ImmutableArray<Symbol> symbols, 1045MethodSymbol method = (MethodSymbol)(Symbol)result.Member; 1085ImmutableArray<Symbol> symbols, 1154ImmutableArray<Symbol> symbols, 1377static Symbol unwrapIfParamsCollection(MemberResolutionResult<TMember> badArg, ParameterSymbol parameter, bool isLastParameter) 1389private bool HadAmbiguousWorseMethods(BindingDiagnosticBag diagnostics, ImmutableArray<Symbol> symbols, Location location, bool isQuery, BoundExpression receiver, string name) 1453private bool HadAmbiguousBestMethods(BindingDiagnosticBag diagnostics, ImmutableArray<Symbol> symbols, Location location) 1505private static DiagnosticInfoWithSymbols CreateAmbiguousCallDiagnosticInfo(Symbol first, Symbol second, ImmutableArray<Symbol> symbols)
Binder\Semantics\SemanticFacts.cs (2)
24Symbol symbol, 50Symbol symbol,
Binder\SingleLookupResult.cs (2)
25internal readonly Symbol Symbol; 30internal SingleLookupResult(LookupResultKind kind, Symbol symbol, DiagnosticInfo error)
Binder\SwitchBinder.cs (1)
446return new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create(switchGoverningExpression), switchGoverningType ?? CreateErrorType());
Binder\WithClassTypeParametersBinder.cs (1)
30internal override bool IsAccessibleHelper(Symbol symbol, TypeSymbol accessThroughType, out bool failedThroughTypeCheck, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved)
Binder\WithLambdaParametersBinder.cs (3)
53internal override Symbol ContainingMemberOrLambda 116private static bool ReportConflictWithParameter(ParameterSymbol parameter, Symbol newSymbol, string name, Location newLocation, BindingDiagnosticBag diagnostics) 158internal override bool EnsureSingleDefinition(Symbol symbol, string name, Location location, BindingDiagnosticBag diagnostics)
Binder\WithMethodTypeParametersBinder.cs (1)
29internal override Symbol ContainingMemberOrLambda
Binder\WithUsingNamespacesAndTypesBinder.cs (4)
139ImmutableArray<Symbol> candidates = Binder.GetCandidateMembers(typeOrNamespace.NamespaceOrType, name, options, originalBinder: originalBinder); 140foreach (Symbol symbol in candidates) 161private static bool IsValidLookupCandidateInUsings(Symbol symbol) 207foreach (var member in namespaceSymbol.NamespaceOrType.GetMembersUnordered())
BoundTree\BoundDagEvaluation.cs (2)
31private Symbol? Symbol 51static Symbol? getSymbolFromIndexerAccess(BoundExpression indexerAccess)
BoundTree\BoundDiscardExpression.cs (1)
28public override Symbol ExpressionSymbol
BoundTree\BoundExpression.cs (30)
109public virtual Symbol? ExpressionSymbol 248public override Symbol? ExpressionSymbol 259public override Symbol ExpressionSymbol 270public override Symbol ExpressionSymbol 272get { return this.AliasOpt ?? (Symbol)this.Type; } 290public override Symbol ExpressionSymbol 292get { return this.AliasOpt ?? (Symbol)this.NamespaceSymbol; } 298public override Symbol ExpressionSymbol 316public override Symbol? ExpressionSymbol 324public override Symbol? ExpressionSymbol 340public override Symbol? ExpressionSymbol 388public override Symbol ExpressionSymbol 396public override Symbol ExpressionSymbol 406public override Symbol? ExpressionSymbol => this.Method; 421public override Symbol ExpressionSymbol 429public override Symbol? ExpressionSymbol 437public override Symbol? ExpressionSymbol 445public override Symbol? ExpressionSymbol 468public override Symbol? ExpressionSymbol 528public override Symbol ExpressionSymbol 559public override Symbol ExpressionSymbol 567public override Symbol ExpressionSymbol 575public override Symbol ExpressionSymbol 583public override Symbol? ExpressionSymbol 612public override Symbol ExpressionSymbol 623public override Symbol ExpressionSymbol 634public override Symbol? ExpressionSymbol 645public override Symbol ExpressionSymbol 668public Symbol ValueSymbol { get; } 674public BoundTypeOrValueData(Symbol valueSymbol, BoundExpression valueExpression, ReadOnlyBindingDiagnostic<AssemblySymbol> valueDiagnostics, BoundExpression typeExpression, ReadOnlyBindingDiagnostic<AssemblySymbol> typeDiagnostics)
BoundTree\BoundExpressionExtensions.cs (4)
168public static void GetExpressionSymbols(this BoundExpression node, ArrayBuilder<Symbol> symbols, BoundNode parent, Binder binder) 187foreach (var s in ((BoundBadExpression)node).Symbols) 196var ctor = expr.Type.GetMembers(WellKnownMemberNames.InstanceConstructorName).FirstOrDefault(); 230var symbol = node.ExpressionSymbol;
BoundTree\Constructors.cs (1)
599public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol type)
BoundTree\NullabilityRewriter.cs (9)
125private T GetUpdatedSymbol<T>(BoundNode expr, T sym) where T : Symbol? 129Symbol? updatedSymbol = null; 145if (_remappedSymbols.TryGetValue(param, out var updatedParam)) 154Symbol remapLambda(BoundLambda boundLambda, LambdaSymbol lambda) 158if (!_remappedSymbols.TryGetValue(lambda.ContainingSymbol, out Symbol? updatedContaining) && updatedDelegateType is null) 186Symbol remapLocal(SourceLocalSymbol local) 188if (_remappedSymbols.TryGetValue(local, out var updatedLocal)) 195if (!_remappedSymbols.TryGetValue(local.ContainingSymbol, out Symbol? updatedContaining) && !updatedType.HasValue) 228private ImmutableArray<T> GetUpdatedArray<T>(BoundNode expr, ImmutableArray<T> symbols) where T : Symbol?
BoundTree\UnboundLambda.cs (5)
164internal LambdaSymbol CreateLambdaSymbol(NamedTypeSymbol delegateType, Symbol containingSymbol) => 168Symbol containingSymbol, 882Symbol containingSymbol, 897internal LambdaSymbol CreateLambdaSymbol(NamedTypeSymbol delegateType, Symbol containingSymbol) 1419=> x.IsExpressionTree == y.IsExpressionTree && Symbol.Equals(x.Type, y.Type, TypeCompareKind.ConsiderEverything);
CodeGen\CodeGenerator_HasHome.cs (2)
45Symbol containingSymbol, 174Symbol containingSymbol,
CodeGen\EmitConversion.cs (1)
379foreach (var possibleCtor in delegateType.GetMembers(WellKnownMemberNames.InstanceConstructorName))
CodeGen\Optimizer.cs (1)
2386public override Symbol ContainingSymbol
CommandLine\CSharpCompiler.cs (6)
247Symbol? entryPoint = comp.ScriptClass; 386var symbol = diag switch 388{ Code: (int)ErrorCode.ERR_BadAccess, Arguments: [Symbol s] } => s, 389{ Code: (int)ErrorCode.ERR_InaccessibleGetter, Arguments: [Symbol s] } => s, 390{ Code: (int)ErrorCode.ERR_InaccessibleSetter, Arguments: [Symbol s] } => s, 391{ Code: (int)ErrorCode.ERR_ImplicitImplementationOfInaccessibleInterfaceMember, Arguments: [_, Symbol s, _] } => s,
Compilation\AttributeSemanticModel.cs (11)
19private readonly Symbol? _attributeTarget; 24Symbol? attributeTarget, 28ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt = null) 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) 108ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols)
Compilation\CSharpCompilation.cs (27)
1188internal new Symbol? GetAssemblyOrModuleSymbol(MetadataReference reference) 1209return (TSymbol?)(object?)symbol.GetSymbol<Symbol>(); 1749internal Symbol GetSpecialTypeMember(SpecialMember specialMember) 1778ImmutableArray<Symbol>.Empty, 2059var taskCandidates = taskEntryPoints.SelectAsArray(s => (Symbol)s.Candidate); 2133symbols: viableEntryPoints.OfType<Symbol>().AsImmutable(), 2157ArrayBuilder<MethodSymbol> entryPointCandidates, IEnumerable<Symbol> members) 2159foreach (var member in members) 2401Symbol? symbol0 = symbol.EnsureCSharpSymbolOrNull(nameof(symbol)); 2402Symbol? within0 = within.EnsureCSharpSymbolOrNull(nameof(within)); 2919private void GetDiagnosticsWithoutSeverityFiltering(CompilationStage stage, bool includeEarlierStages, BindingDiagnosticBag builder, Predicate<Symbol>? symbolFilter, CancellationToken cancellationToken) 3051private static bool IsDefinedOrImplementedInSourceTree(Symbol symbol, SyntaxTree tree, TextSpan? span) 3157filterOpt: filterTree is object ? (Predicate<Symbol>?)(s => IsDefinedOrImplementedInSourceTree(s, filterTree, filterSpan)) : (Predicate<Symbol>?)null, 3199private ReadOnlyBindingDiagnostic<AssemblySymbol> GetSourceDeclarationDiagnostics(SyntaxTree? syntaxTree = null, TextSpan? filterSpanWithinTree = null, Func<IEnumerable<Diagnostic>, SyntaxTree, TextSpan?, IEnumerable<Diagnostic>>? locationFilterOpt = null, Predicate<Symbol>? symbolFilter = null, CancellationToken cancellationToken = default) 3573foreach (var childSymbol in symbol.GetMembers()) 4625internal IEnumerable<Symbol> GetSymbolsWithNameCore(string name, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default) 4688internal bool ShouldEmitNullableAttributes(Symbol symbol) 4714static Symbol getExplicitAccessibilitySymbol(Symbol symbol) 4740internal void SymbolDeclaredEvent(Symbol symbol) 4806var sustainedLowLatency = GetWellKnownTypeMember(WellKnownMember.System_Runtime_GCLatencyMode__SustainedLowLatency); 4840public IEnumerable<Symbol> GetSymbolsWithName() 4842var result = new HashSet<Symbol>(); 4854HashSet<Symbol> set) 4908ArrayBuilder<MergedNamespaceOrTypeDeclaration> spine, MergedTypeDeclaration current, HashSet<Symbol> set) 4916foreach (var member in container.GetMembers())
Compilation\CSharpSemanticModel.cs (128)
167internal abstract BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols); 177internal abstract ImmutableArray<Symbol> GetMemberGroupWorker(CSharpSyntaxNode node, SymbolInfoOptions options, CancellationToken cancellationToken = default(CancellationToken)); 279protected BoundExpression GetSpeculativelyBoundExpressionWithoutNullability(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols) 286crefSymbols = default(ImmutableArray<Symbol>); 298crefSymbols = ImmutableArray.Create<Symbol>(binder.BindType(expression, BindingDiagnosticBag.Discarded).Type); 324internal static ImmutableArray<Symbol> BindCref(CrefSyntax crefSyntax, Binder binder) 326Symbol unusedAmbiguityWinner; 336ImmutableArray<Symbol> symbols = BindCref(crefSyntax, binder); 365private static SymbolInfo GetCrefSymbolInfo(OneOrMany<Symbol> symbols, SymbolInfoOptions options, bool hasParameterList) 721ImmutableArray<Symbol> crefSymbols; 1051ImmutableArray<Symbol> crefSymbols; 1198ImmutableArray<Symbol> crefSymbols; 1690Symbol uniqueSymbol; 1752Symbol singleSymbol = binder.ResultSymbol(lookupResult, name, arity, this.Root, BindingDiagnosticBag.Discarded, true, out wasError, container, options); 1778private Symbol RemapSymbolIfNecessary(Symbol symbol) 1796internal abstract Symbol RemapSymbolIfNecessaryCore(Symbol symbol); 1813public bool IsAccessible(int position, Symbol symbol) 1865Constraint = "Provide " + nameof(ArrayBuilder<Symbol>) + " capacity to reduce number of allocations.")] 1902OneOrMany<Symbol> symbols = GetSemanticSymbols( 1903boundExpr, boundNodeForSyntacticParent, binderOpt, options, out bool isDynamic, out LookupResultKind resultKind, out ImmutableArray<Symbol> unusedMemberGroup); 1909ImmutableArray<Symbol> unusedHighestMemberGroup; 1910OneOrMany<Symbol> highestSymbols = GetSemanticSymbols( 1949return SymbolInfoFactory.Create(ImmutableArray<Symbol>.Empty, LookupResultKind.Empty, isDynamic); 1955var builder = ArrayBuilder<Symbol>.GetInstance(symbols.Count); 1956foreach (Symbol symbol in symbols) 1977private static SymbolInfo GetSymbolInfoForSubpattern(Symbol subpatternSymbol) 1992private static void AddUnwrappingErrorTypes(ArrayBuilder<Symbol> builder, Symbol s) 2272internal ImmutableArray<Symbol> GetMemberGroupForNode( 2281ImmutableArray<Symbol> memberGroup; 2288return ImmutableArray<Symbol>.Empty; 2310internal static SymbolInfo GetSymbolInfoForSymbol(Symbol symbol, SymbolInfoOptions options) 2315Symbol unwrapped = UnwrapAlias(symbol); 2324var symbols = OneOrMany<Symbol>.Empty; 2342var symbolToReturn = ((options & SymbolInfoOptions.ResolveAliases) != 0) ? unwrapped : symbol; 2348internal static CSharpTypeInfo GetTypeInfoForSymbol(Symbol symbol) 2358protected static Symbol UnwrapAlias(Symbol symbol) 2363protected static OneOrMany<Symbol> UnwrapAliases(OneOrMany<Symbol> symbols) 2367foreach (Symbol symbol in symbols) 2376ArrayBuilder<Symbol> builder = ArrayBuilder<Symbol>.GetInstance(); 2377foreach (Symbol symbol in symbols) 3341private OneOrMany<Symbol> GetSemanticSymbols( 3348out ImmutableArray<Symbol> memberGroup) 3350memberGroup = ImmutableArray<Symbol>.Empty; 3351OneOrMany<Symbol> symbols = OneOrMany<Symbol>.Empty; 3406var typeSymbol = boundType.AliasOpt ?? (Symbol)boundType.Type; 3449symbols = StaticCast<Symbol>.From(CreateReducedExtensionMethodsFromOriginalsIfNecessary(call, Compilation)); 3458symbols = OneOrMany.Create<Symbol>(invocation.FunctionPointer); 3487symbols = originalIndexersOpt.IsDefault ? OneOrMany.Create<Symbol>(indexerAccess.Indexer) : StaticCast<Symbol>.From(OneOrMany.Create(originalIndexersOpt)); 3502symbols = OneOrMany<Symbol>.Empty; 3507symbols = OneOrMany.Create<Symbol>(methodSymbol); 3513boundNode.ExpressionSymbol is Symbol accessSymbol && 3519symbols = OneOrMany.Create<Symbol>(parentOperator.Event); 3532symbols = OneOrMany.Create<Symbol>(ReducedExtensionMethodSymbol.Create(symbol)); 3617var builder = ArrayBuilder<Symbol>.GetInstance(); 3628memberGroup = dynamicInvocation.ApplicableMethods.Cast<MethodSymbol, Symbol>(); 3636memberGroup = collectionInit.ApplicableMethods.Cast<MethodSymbol, Symbol>(); 3644memberGroup = dynamicIndexer.ApplicableIndexers.Cast<PropertySymbol, Symbol>(); 3656memberGroup = objectCreation.ApplicableMethods.Cast<MethodSymbol, Symbol>(); 3667symbols = OneOrMany.Create<Symbol>(boundObjectCreation.Constructor); 3671symbols = StaticCast<Symbol>.From(OneOrMany.Create(boundObjectCreation.ConstructorsGroup)); 3675memberGroup = boundObjectCreation.ConstructorsGroup.Cast<MethodSymbol, Symbol>(); 3683var containingMember = binder.ContainingMember(); 3686symbols = thisParam != null ? OneOrMany.Create<Symbol>(thisParam) : OneOrMany<Symbol>.Empty; 3695symbols = OneOrMany.Create<Symbol>(fromEndIndexExpression.MethodOpt); 3705symbols = OneOrMany.Create<Symbol>(rangeExpression.MethodOpt); 3712if (boundNode.ExpressionSymbol is Symbol symbol) 3730private static ParameterSymbol GetThisParameter(TypeSymbol typeOfThis, NamedTypeSymbol containingType, Symbol containingMember, out LookupResultKind resultKind) 3793private static void GetSymbolsAndResultKind(BoundUnaryOperator unaryOperator, out bool isDynamic, ref LookupResultKind resultKind, ref OneOrMany<Symbol> symbols) 3809symbols = OneOrMany.Create<Symbol>(new SynthesizedIntrinsicOperatorSymbol(unaryOperator.Operand.Type.StrippedType(), 3816private static void GetSymbolsAndResultKind(BoundIncrementOperator increment, out bool isDynamic, ref LookupResultKind resultKind, ref OneOrMany<Symbol> symbols) 3833symbols = OneOrMany.Create<Symbol>(new SynthesizedIntrinsicOperatorSymbol(opType, 3840private static void GetSymbolsAndResultKind(BoundBinaryOperator binaryOperator, out bool isDynamic, ref LookupResultKind resultKind, ref OneOrMany<Symbol> symbols) 3866symbols = OneOrMany.Create<Symbol>(new SynthesizedIntrinsicOperatorSymbol(objectType, 3884private static Symbol GetIntrinsicOperatorSymbol(BinaryOperatorKind op, bool isDynamic, TypeSymbol leftType, TypeSymbol rightType, TypeSymbol returnType, bool isChecked) 3913private static void GetSymbolsAndResultKind(BoundCompoundAssignmentOperator compoundAssignment, out bool isDynamic, ref LookupResultKind resultKind, ref OneOrMany<Symbol> symbols) 3939private static void GetSymbolsAndResultKind(BoundExpression node, Symbol symbolOpt, ImmutableArray<MethodSymbol> originalCandidates, out OneOrMany<Symbol> symbols, out LookupResultKind resultKind) 3948symbols = StaticCast<Symbol>.From(OneOrMany.Create(originalCandidates)); 3953symbols = OneOrMany<Symbol>.Empty; 3966ref OneOrMany<Symbol> symbols, 3967ref ImmutableArray<Symbol> memberGroup) 4019ref OneOrMany<Symbol> symbols, 4020ref ImmutableArray<Symbol> memberGroup) 4060symbols = OneOrMany.Create<Symbol>(constructorOpt); 4064symbols = StaticCast<Symbol>.From(OneOrMany.Create(candidateConstructors)); 4069memberGroup = candidateConstructors.Cast<MethodSymbol, Symbol>(); 4110PooledHashSet<Symbol> hiddenSymbols = null; 4113Symbol symbol = iSymbol.GetSymbol(); 4119foreach (Symbol overridden in overriddenOrHiddenMembers.OverriddenMembers) 4123hiddenSymbols = PooledHashSet<Symbol>.GetInstance(); 4131foreach (Symbol hidden in overriddenOrHiddenMembers.HiddenMembers) 4135hiddenSymbols = PooledHashSet<Symbol>.GetInstance(); 4203HashSet<Symbol> hiddenSymbols = new HashSet<Symbol>(); 4208foreach (Symbol overridden in overriddenOrHiddenMembers.OverriddenMembers) 4216foreach (Symbol hidden in overriddenOrHiddenMembers.HiddenMembers) 4232private OneOrMany<Symbol> GetMethodGroupSemanticSymbols( 4238out ImmutableArray<Symbol> methodGroup) 4242OneOrMany<Symbol> symbols = OneOrMany<Symbol>.Empty; 4254methodGroup = GetReducedAndFilteredMethodGroupSymbols(binder, boundNode).Cast<MethodSymbol, Symbol>(); 4277symbols = StaticCast<Symbol>.From(CreateReducedExtensionMethodsFromOriginalsIfNecessary(call, Compilation)); 4314symbols = OneOrMany.Create((Symbol)method); 4326symbols = OneOrMany.Create(dynamicInvocation.ApplicableMethods.Cast<MethodSymbol, Symbol>()); 4332ImmutableArray<Symbol> myMethodGroup = methodGroup; 4385private OneOrMany<Symbol> GetPropertyGroupSemanticSymbols( 4390out ImmutableArray<Symbol> propertyGroup) 4394OneOrMany<Symbol> symbols = OneOrMany<Symbol>.Empty; 4403propertyGroup = boundNode.Properties.Cast<PropertySymbol, Symbol>(); 4420symbols = OneOrMany.Create<Symbol>(indexer.Indexer); 4426symbols = StaticCast<Symbol>.From(OneOrMany.Create(indexer.OriginalIndexersOpt)); 4433ImmutableArray<Symbol> myPropertyGroup = propertyGroup; 4591var otherSymbol = node.LookupSymbolOpt; 4784private OneOrMany<Symbol> CreateReducedExtensionMethodIfPossible(BoundCall call) 4798return OneOrMany.Create<Symbol>(method); 4801private OneOrMany<Symbol> CreateReducedExtensionMethodIfPossible(BoundDelegateCreationExpression delegateCreation, BoundExpression receiverOpt) 4811return OneOrMany.Create<Symbol>(method);
Compilation\InitializerSemanticModel.cs (10)
27Symbol symbol, 30ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt = null) : 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) 259ref ImmutableDictionary<Symbol, Symbol> remappedSymbols)
Compilation\LexicalOrderSymbolComparer.cs (3)
18internal class LexicalOrderSymbolComparer : IComparer<Symbol> 26public int Compare(Symbol x, Symbol y)
Compilation\MemberSemanticModel.cs (26)
28private readonly Symbol _memberSymbol; 36private ImmutableDictionary<Symbol, Symbol> _lazyRemappedSymbols; 37private readonly ImmutableDictionary<Symbol, Symbol> _parentRemappedSymbolsOpt; 47Symbol memberSymbol, 50ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt) 84internal Symbol MemberSymbol 162internal ImmutableDictionary<Symbol, Symbol> GetRemappedSymbols() 191internal override BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols) 205ImmutableDictionary<Symbol, Symbol> ignored = null; 720private T GetRemappedSymbol<T>(T originalSymbol) where T : Symbol 725if (_lazyRemappedSymbols.TryGetValue(originalSymbol, out Symbol? remappedSymbol)) 1232internal override ImmutableArray<Symbol> GetMemberGroupWorker(CSharpSyntaxNode node, SymbolInfoOptions options, CancellationToken cancellationToken = default(CancellationToken)) 1473protected void UnguardedAddBoundTreeForStandaloneSyntax(SyntaxNode syntax, BoundNode bound, NullableWalker.SnapshotManager manager = null, ImmutableDictionary<Symbol, Symbol> remappedSymbols = null) 1481protected void GuardedAddBoundTreeForStandaloneSyntax(SyntaxNode syntax, BoundNode bound, NullableWalker.SnapshotManager manager = null, ImmutableDictionary<Symbol, Symbol> remappedSymbols = null) 2045ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols); 2340internal override Symbol RemapSymbolIfNecessaryCore(Symbol symbol) 2351if (_lazyRemappedSymbols.TryGetValue(symbol, out var remappedSymbol))
Compilation\MemberSemanticModel.SpeculativeMemberSemanticModel.cs (5)
28Symbol owner, 31ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt) 49ref ImmutableDictionary<Symbol, Symbol> remappedSymbols)
Compilation\MethodBodySemanticModel.cs (12)
25internal readonly ImmutableDictionary<Symbol, Symbol>? RemappedSymbols; 32ImmutableDictionary<Symbol, Symbol>? remappedSymbols = null) 48ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt = null) 116ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt, 128ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt, 292ref ImmutableDictionary<Symbol, Symbol> remappedSymbols)
Compilation\PublicSemanticModel.cs (2)
23Symbol? attributeTarget = getAttributeTarget(attribute.Parent?.Parent); 34Symbol? getAttributeTarget(SyntaxNode? targetSyntax)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (15)
48ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt) 57static Symbol? getAttributeTargetFromPosition(int position, SyntaxTreeSemanticModel model) 74Symbol owner, 77ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt) 90Symbol owner, 93ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt, 106ImmutableDictionary<Symbol, Symbol>? parentRemappedSymbolsOpt, 460internal override ImmutableArray<Symbol> GetMemberGroupWorker(CSharpSyntaxNode node, SymbolInfoOptions options, CancellationToken cancellationToken = default(CancellationToken)) 500internal override Symbol RemapSymbolIfNecessaryCore(Symbol symbol) 565internal override BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols)
Compilation\SymbolInfoFactory.cs (3)
19internal static SymbolInfo Create(ImmutableArray<Symbol> symbols, LookupResultKind resultKind, bool isDynamic) 22internal static SymbolInfo Create(OneOrMany<Symbol> symbols, LookupResultKind resultKind, bool isDynamic) 52static ImmutableArray<ISymbol> getPublicSymbols(OneOrMany<Symbol> symbols)
Compilation\SyntaxTreeSemanticModel.cs (17)
284var symbol = GetSemanticInfoSymbolInNonMemberContext(node, bindVarAsAliasFirst: (options & SymbolInfoOptions.PreserveAliases) != 0); 322var symbol = GetSemanticInfoSymbolInNonMemberContext(node, bindVarAsAliasFirst: false); // Don't care about aliases here. 330private Symbol GetSemanticInfoSymbolInNonMemberContext(CSharpSyntaxNode node, bool bindVarAsAliasFirst) 356Symbol result = bindVarAsAliasFirst 397internal override ImmutableArray<Symbol> GetMemberGroupWorker(CSharpSyntaxNode node, SymbolInfoOptions options, CancellationToken cancellationToken = default(CancellationToken)) 403return model == null ? ImmutableArray<Symbol>.Empty : model.GetMemberGroupWorker(node, options, cancellationToken); 738internal override BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols) 1751private Symbol GetDeclaredMember(NamespaceOrTypeSymbol container, TextSpan declarationSpan, bool isKnownToBeANamespace, string name = null) 1779Symbol zeroWidthMatch = null; 1780foreach (var symbol in collection) 1786var result = GetDeclaredMember(namedType, declarationSpan, isKnownToBeANamespace, name); 1803Symbol partial = symbol switch 1843var result = this.GetDeclaredMember(container, declarationSyntax.Span, isKnownToBeANamespace: false, declarationSyntax.Identifier.ValueText); 2293private static BoundNode GetBoundRoot(MemberSemanticModel memberModel, out Symbol member) 2345private Symbol GetDeclaredMemberSymbol(CSharpSyntaxNode declarationSyntax) 2384internal override Symbol RemapSymbolIfNecessaryCore(Symbol symbol)
Compilation\SyntaxTreeSemanticModel_RegionAnalysisContext.cs (2)
38Symbol member; 55Symbol member;
Compiler\ClsComplianceChecker.cs (36)
32private readonly ConcurrentDictionary<Symbol, Compliance> _declaredOrInheritedCompliance; 52_declaredOrInheritedCompliance = new ConcurrentDictionary<Symbol, Compliance>(Symbols.SymbolEqualityComparer.ConsiderEverything); 212foreach (var m in symbol.GetMembersUnordered()) 230foreach (var m in symbol.GetMembersUnordered()) 267foreach (var m in symbol.GetMembersUnordered()) 420private bool VisitTypeOrMember(Symbol symbol, Compliance compliance) 497private void CheckForNonCompliantAbstractMember(Symbol symbol) 541private void CheckForCompliantWithinNonCompliant(Symbol symbol) 585private void CheckForAttributeWithArrayArgument(Symbol symbol) 680Symbol container = parameters[0].ContainingSymbol; 683Symbol associated = ((MethodSymbol)container).AssociatedSymbol; 711private void CheckReturnTypeCompliance(Symbol symbol) 784private bool CheckForDeclarationWithoutAssemblyDeclaration(Symbol symbol, Compliance compliance) 807MultiDictionary<string, Symbol> seenByName = new MultiDictionary<string, Symbol>(CaseInsensitiveComparison.Comparer); 823foreach (Symbol member in @interface.GetMembersUnordered()) 838foreach (Symbol member in baseType.GetMembersUnordered()) 855foreach (Symbol member in symbol.GetMembers()) 884private void CheckSymbolDistinctness(Symbol symbol, string symbolName, MultiDictionary<string, Symbol>.ValueSet sameNameSymbols) 891foreach (Symbol other in sameNameSymbols) 906foreach (Symbol other in sameNameSymbols) 927private void CheckName(Symbol symbol) 960private bool DoNotVisit(Symbol symbol) 973private bool IsSyntacticallyFilteredOut(Symbol symbol) 1114private Compliance GetDeclaredOrInheritedCompliance(Symbol symbol) 1127Symbol associated = method.AssociatedSymbol; 1170private Compliance GetInheritedCompliance(Symbol symbol) 1174Symbol containing = (Symbol)symbol.ContainingType ?? symbol.ContainingAssembly; 1184private bool? GetDeclaredCompliance(Symbol symbol, out Location attributeLocation) 1220private static bool IsAccessibleOutsideAssembly(Symbol symbol) 1233private static bool IsAccessibleIfContainerIsAccessible(Symbol symbol) 1267private static bool IsImplicitClass(Symbol symbol) 1316private static bool TryGetCollisionErrorCode(Symbol x, Symbol y, out ErrorCode code)
Compiler\DocumentationCommentCompiler.cs (19)
139internal static string GetDocumentationCommentXml(Symbol symbol, bool processIncludes, CancellationToken cancellationToken) 200foreach (var s in symbol.GetMembers()) 231foreach (Symbol member in symbol.GetMembers()) 244public override void DefaultVisit(Symbol symbol) 261Symbol? implementationPart = symbol switch 293var symbolForDocComments = symbol is SynthesizedRecordPropertySymbol ? symbol.ContainingType : symbol; 410private static bool ShouldSkip(Symbol symbol) 492Symbol symbol, 599private static Location GetLocationInTreeReportingDocumentationCommentDiagnostics(Symbol symbol) 615private static ImmutableArray<ParameterSymbol> GetParameters(Symbol symbol) 638private static ImmutableArray<TypeParameterSymbol> GetTypeParameters(Symbol symbol) 656private static bool RequiresDocumentationComment(Symbol symbol) 687private bool TryGetDocumentationCommentNodes(Symbol symbol, out DocumentationMode maxDocumentationMode, out ImmutableArray<DocumentationCommentTriviaSyntax> nodes) 1071Symbol ambiguityWinner; 1072ImmutableArray<Symbol> symbols = binder.BindCref(crefSyntax, out ambiguityWinner, diagnostics); 1074Symbol symbol; 1128Symbol memberSymbol, 1161ImmutableArray<Symbol> referencedSymbols = binder.BindXmlNameAttribute(syntax, ref useSiteInfo); 1186foreach (Symbol referencedSymbol in referencedSymbols)
Compiler\DocumentationCommentCompiler.DocumentationCommentWalker.cs (3)
33private readonly Symbol _memberSymbol; 43Symbol memberSymbol, 120Symbol symbol,
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (6)
30private readonly Symbol _memberSymbol; 43Symbol memberSymbol, 67Symbol memberSymbol, 547private static Binder MakeNameBinder(bool isParameter, bool isTypeParameterRef, Symbol memberSymbol, CSharpCompilation compilation, SyntaxTree syntaxTree) 552Symbol containingSymbol = memberSymbol.ContainingSymbol; 585Symbol currentSymbol = memberSymbol;
Compiler\MethodBodySynthesizer.cs (1)
598foreach (Symbol member in baseType.GetMembers(WellKnownMemberNames.DestructorName))
Compiler\MethodCompiler.cs (10)
38private readonly Predicate<Symbol> _filterOpt; // If not null, limit analysis to specific symbols 88BindingDiagnosticBag diagnostics, Predicate<Symbol> filterOpt, SynthesizedEntryPointSymbol.AsyncForwardEntryPoint entryPointOpt, CancellationToken cancellationToken) 116Predicate<Symbol> filterOpt, 404foreach (var s in symbol.GetMembersUnordered()) 496var member = members[memberOrdinal]; 1799ImmutableDictionary<Symbol, Symbol>? remappedSymbols = null; 2328private static BoundBlock GetSynthesizedEmptyBody(Symbol symbol) 2372private static bool PassesFilter(Predicate<Symbol> filterOpt, Symbol symbol)
Compiler\SynthesizedMetadataCompiler.cs (2)
56foreach (var s in symbol.GetMembers()) 91foreach (Symbol member in symbol.GetMembers())
Declarations\DeclarationTreeBuilder.cs (2)
697Symbol.ReportErrorIfHasConstraints(node.ConstraintClauses, diagnostics); 809Symbol.ReportErrorIfHasConstraints(node.ConstraintClauses, diagnostics);
DocumentationComments\DocumentationCommentIDVisitor.cs (1)
20public override object DefaultVisit(Symbol symbol, StringBuilder builder)
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (2)
153Symbol containingSymbol = symbol.ContainingSymbol; 272private static string GetEscapedMetadataName(Symbol symbol)
DocumentationComments\PEDocumentationCommentUtils.cs (1)
20Symbol symbol,
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
20internal static string GetAndCacheDocumentationComment(Symbol symbol, bool expandIncludes, ref string lazyXmlText)
Emitter\EditAndContinue\CSharpDefinitionMap.cs (1)
68foreach (var member in ((TypeSymbol)stateMachineType).GetMembers())
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (44)
54if (definition.GetInternalSymbol() is Symbol symbol) 78if (reference.GetInternalSymbol() is Symbol symbol) 89private sealed class Visitor : CSharpSymbolVisitor<Symbol?> 106private readonly ConcurrentDictionary<Symbol, Symbol?> _matches = new(ReferenceEqualityComparer.Instance); 132public override Symbol DefaultVisit(Symbol symbol) 138public override Symbol? Visit(Symbol symbol) 147public override Symbol? VisitArrayType(ArrayTypeSymbol symbol) 166public override Symbol? VisitEvent(EventSymbol symbol) 169public override Symbol? VisitField(FieldSymbol symbol) 172public override Symbol? VisitMethod(MethodSymbol symbol) 179public override Symbol? VisitModule(ModuleSymbol module) 208public override Symbol? VisitAssembly(AssemblySymbol assembly) 246public override Symbol? VisitNamespace(NamespaceSymbol @namespace) 248var otherContainer = Visit(@namespace.ContainingSymbol); 271public override Symbol VisitDynamicType(DynamicTypeSymbol symbol) 276public override Symbol? VisitNamedType(NamedTypeSymbol sourceType) 320var otherContainer = this.Visit(sourceType.ContainingSymbol); 367public override Symbol VisitParameter(ParameterSymbol parameter) 373public override Symbol? VisitPointerType(PointerTypeSymbol symbol) 386public override Symbol? VisitFunctionPointerType(FunctionPointerTypeSymbol symbol) 428public override Symbol? VisitProperty(PropertySymbol symbol) 431public override Symbol VisitTypeParameter(TypeParameterSymbol symbol) 438var otherContainer = Visit(symbol.ContainingSymbol); 531private Symbol? VisitNamedTypeMember<T>(T member, Func<T, T, bool> predicate) 532where T : Symbol 547where T : Symbol 837internal sealed class DeepTranslator : CSharpSymbolVisitor<Symbol> 839private readonly ConcurrentDictionary<Symbol, Symbol> _matches; 844_matches = new ConcurrentDictionary<Symbol, Symbol>(ReferenceEqualityComparer.Instance); 848public override Symbol DefaultVisit(Symbol symbol) 854public override Symbol Visit(Symbol symbol) 859public override Symbol VisitArrayType(ArrayTypeSymbol symbol) 872public override Symbol VisitDynamicType(DynamicTypeSymbol symbol) 877public override Symbol VisitNamedType(NamedTypeSymbol type) 902public override Symbol VisitPointerType(PointerTypeSymbol symbol) 909public override Symbol VisitFunctionPointerType(FunctionPointerTypeSymbol symbol) 938public override Symbol VisitTypeParameter(TypeParameterSymbol symbol)
Emitter\Model\ArrayTypeSymbolAdapter.cs (1)
109internal sealed override Symbol AdaptedSymbol => AdaptedArrayTypeSymbol;
Emitter\Model\AttributeDataAdapter.cs (3)
161var symbol = LookupName(name); 178private Symbol LookupName(string name) 183foreach (var member in type.GetMembers(name))
Emitter\Model\EventSymbolAdapter.cs (1)
207internal sealed override Symbol AdaptedSymbol => AdaptedEventSymbol;
Emitter\Model\FieldSymbolAdapter.cs (1)
351internal sealed override Symbol AdaptedSymbol => AdaptedFieldSymbol;
Emitter\Model\FunctionPointerTypeSymbolAdapter.cs (1)
129internal sealed override Symbol AdaptedSymbol => AdaptedFunctionPointerTypeSymbol;
Emitter\Model\MethodReference.cs (1)
26protected override Symbol UnderlyingSymbol
Emitter\Model\MethodSymbolAdapter.cs (1)
713internal sealed override Symbol AdaptedSymbol => AdaptedMethodSymbol;
Emitter\Model\NamedTypeSymbolAdapter.cs (7)
323foreach (var member in AdaptedNamedTypeSymbol.GetMembers()) 366foreach (Symbol objectMember in objectType.GetMembers(WellKnownMemberNames.DestructorName)) 526foreach (var member in AdaptedNamedTypeSymbol.GetMembers(WellKnownMemberNames.StaticConstructorName)) 942foreach (var m in this.GetMembers()) 1021foreach (var m in this.GetMembers()) 1038foreach (var m in this.GetMembers()) 1062internal sealed override Symbol AdaptedSymbol => AdaptedNamedTypeSymbol;
Emitter\Model\NamespaceSymbolAdapter.cs (1)
59internal sealed override Symbol AdaptedSymbol => AdaptedNamespaceSymbol;
Emitter\Model\ParameterSymbolAdapter.cs (1)
282internal sealed override Symbol AdaptedSymbol => AdaptedParameterSymbol;
Emitter\Model\PEModuleBuilder.cs (21)
29protected readonly ConcurrentDictionary<Symbol, Cci.IModuleReference> AssemblyOrModuleSymbolToModuleRefMap = new ConcurrentDictionary<Symbol, Cci.IModuleReference>(); 30private readonly ConcurrentDictionary<Symbol, object> _genericInstanceMap = new ConcurrentDictionary<Symbol, object>(Symbols.SymbolEqualityComparer.ConsiderEverything); 357foreach (var member in symbol.GetMembers()) 380foreach (var member in symbol.GetMembers()) 441private void AddSymbolLocation(MultiDictionary<Cci.DebugSourceDocument, Cci.DefinitionWithLocation> result, Symbol symbol) 468private Location GetSmallestSourceLocationOrNull(Symbol symbol) 567foreach (var member in ns.GetMembers()) 600foreach (var member in symbol.GetMembers()) 823Symbol.ReportUseSiteDiagnostic(info, 1072private object GetCciAdapter(Symbol symbol) 1393var container = param.ContainingSymbol; 1429private static bool ContainerIsGeneric(Symbol container) 1492internal SynthesizedAttributeData SynthesizeIsReadOnlyAttribute(Symbol symbol) 1525internal SynthesizedAttributeData SynthesizeIsUnmanagedAttribute(Symbol symbol) 1536internal SynthesizedAttributeData SynthesizeIsByRefLikeAttribute(Symbol symbol) 1552internal SynthesizedAttributeData SynthesizeNullableAttributeIfNecessary(Symbol symbol, byte? nullableContextValue, TypeWithAnnotations type) 1612internal SynthesizedAttributeData SynthesizeNullableContextAttribute(Symbol symbol, byte value) 1637internal SynthesizedAttributeData SynthesizeNativeIntegerAttribute(Symbol symbol, TypeSymbol type) 1967Symbol.ReportUseSiteDiagnostic(info, diagnostics, syntaxNode.Location);
Emitter\Model\PointerTypeSymbolAdapter.cs (1)
150internal sealed override Symbol AdaptedSymbol => AdaptedPointerTypeSymbol;
Emitter\Model\PropertySymbolAdapter.cs (1)
339internal sealed override Symbol AdaptedSymbol => AdaptedPropertySymbol;
Emitter\Model\SourceAssemblySymbolAdapter.cs (1)
28Symbol.AddSynthesizedAttribute(ref synthesized, referenceAssemblyAttribute);
Emitter\Model\SpecializedFieldReference.cs (1)
31protected override Symbol UnderlyingSymbol
Emitter\Model\SymbolAdapter.cs (1)
173internal abstract Symbol AdaptedSymbol { get; }
Emitter\Model\TypeMemberReference.cs (1)
15protected abstract Symbol UnderlyingSymbol { get; }
Emitter\Model\TypeParameterSymbolAdapter.cs (1)
395internal sealed override Symbol AdaptedSymbol => AdaptedTypeParameterSymbol;
Emitter\NoPia\EmbeddedEvent.cs (1)
131foreach (Symbol m in sourceInterface.GetMembers(UnderlyingEvent.AdaptedEventSymbol.MetadataName))
Emitter\NoPia\EmbeddedType.cs (1)
297foreach (Symbol s in UnderlyingNamedType.AdaptedNamedTypeSymbol.GetMembers(defaultMember))
Emitter\NoPia\EmbeddedTypesManager.cs (7)
40private readonly ConcurrentDictionary<Symbol, bool> _reportedSymbolsMap = new ConcurrentDictionary<Symbol, bool>(ReferenceEqualityComparer.Instance); 72Symbol.ReportUseSiteDiagnostic(info.DiagnosticInfo, 109Symbol.ReportUseSiteDiagnostic(info.DiagnosticInfo, 270foreach (Symbol member in namedType.GetMembersUnordered()) 329private static void ReportNotEmbeddableSymbol(ErrorCode error, Symbol symbol, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics, EmbeddedTypesManager optTypeManager) 509Symbol propertyOrEvent = method.AdaptedMethodSymbol.AssociatedSymbol;
Errors\CSDiagnosticInfo.cs (4)
23: this(code, Array.Empty<object>(), ImmutableArray<Symbol>.Empty, ImmutableArray<Location>.Empty) 28: this(code, args, ImmutableArray<Symbol>.Empty, ImmutableArray<Location>.Empty) 32internal CSDiagnosticInfo(ErrorCode code, ImmutableArray<Symbol> symbols, object[] args) 37internal CSDiagnosticInfo(ErrorCode code, object[] args, ImmutableArray<Symbol> symbols, ImmutableArray<Location> additionalLocations)
Errors\DiagnosticBagExtensions.cs (1)
45internal static CSDiagnosticInfo Add(this DiagnosticBag diagnostics, ErrorCode code, Location location, ImmutableArray<Symbol> symbols, params object[] args)
Errors\DiagnosticInfoWithSymbols.cs (3)
14internal readonly ImmutableArray<Symbol> Symbols; 16internal DiagnosticInfoWithSymbols(ErrorCode errorCode, object[] arguments, ImmutableArray<Symbol> symbols) 22internal DiagnosticInfoWithSymbols(bool isWarningAsError, ErrorCode errorCode, object[] arguments, ImmutableArray<Symbol> symbols)
Errors\LazyObsoleteDiagnosticInfo.cs (5)
15private readonly Symbol _containingSymbol; 18internal LazyObsoleteDiagnosticInfo(object symbol, Symbol containingSymbol, BinderFlags binderFlags) 20Debug.Assert(symbol is Symbol || symbol is TypeWithAnnotations); 42var symbol = (_symbolOrSymbolWithAnnotations as Symbol) ?? ((TypeWithAnnotations)_symbolOrSymbolWithAnnotations).Type;
Errors\MessageProvider.cs (1)
89var info = new CSDiagnosticInfo((ErrorCode)code, args, ImmutableArray<Symbol>.Empty, ImmutableArray<Location>.Empty);
FlowAnalysis\AbstractFlowPass.cs (3)
56protected Symbol _symbol; 61protected Symbol CurrentSymbol; 184Symbol symbol,
FlowAnalysis\AbstractFlowPass_LocalFunctions.cs (1)
72var oldSymbol = this.CurrentSymbol;
FlowAnalysis\AbstractRegionControlFlowPass.cs (1)
16Symbol member,
FlowAnalysis\AbstractRegionDataFlowPass.cs (2)
18Symbol member, 22HashSet<Symbol> initiallyAssignedVariables = null,
FlowAnalysis\AlwaysAssignedWalker.cs (7)
27private AlwaysAssignedWalker(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion) 32internal static IEnumerable<Symbol> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion) 39return badRegion ? SpecializedCollections.EmptyEnumerable<Symbol>() : result; 47private List<Symbol> Analyze(ref bool badRegion) 50List<Symbol> result = new List<Symbol>();
FlowAnalysis\ControlFlowPass.cs (3)
34internal ControlFlowPass(CSharpCompilation compilation, Symbol member, BoundNode node) 39internal ControlFlowPass(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion) 154public static bool Analyze(CSharpCompilation compilation, Symbol member, BoundBlock block, DiagnosticBag diagnostics)
FlowAnalysis\CSharpDataFlowAnalysis.cs (6)
29private HashSet<Symbol> _unassignedVariables; 76private HashSet<Symbol> UnassignedVariables 84: new HashSet<Symbol>(); 254IEnumerable<Symbol> readInside, writtenInside, readOutside, writtenOutside, captured, unsafeAddressTaken, capturedInside, capturedOutside; 266readInside = writtenInside = readOutside = writtenOutside = captured = unsafeAddressTaken = capturedInside = capturedOutside = Enumerable.Empty<Symbol>(); 390private static ImmutableArray<ISymbol> Normalize(IEnumerable<Symbol> data)
FlowAnalysis\DataFlowsInWalker.cs (10)
25private readonly HashSet<Symbol> _dataFlowsIn = new HashSet<Symbol>(); 27private DataFlowsInWalker(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, 28HashSet<Symbol> unassignedVariables, HashSet<PrefixUnaryExpressionSyntax> unassignedVariableAddressOfSyntaxes) 33internal static HashSet<Symbol> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, 34HashSet<Symbol> unassignedVariables, HashSet<PrefixUnaryExpressionSyntax> unassignedVariableAddressOfSyntaxes, out bool? succeeded) 42return badRegion ? new HashSet<Symbol>() : result; 50private HashSet<Symbol> Analyze(ref bool badRegion) 103protected override void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration)
FlowAnalysis\DataFlowsOutWalker.cs (16)
27private DataFlowsOutWalker(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, HashSet<Symbol> unassignedVariables, ImmutableArray<ISymbol> dataFlowsIn) 33internal static HashSet<Symbol> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, HashSet<Symbol> unassignedVariables, ImmutableArray<ISymbol> dataFlowsIn) 46return badRegion ? new HashSet<Symbol>() : result; 54private readonly HashSet<Symbol> _dataFlowsOut = new HashSet<Symbol>(); 58private readonly HashSet<Symbol> _assignedInside = new HashSet<Symbol>(); 61private HashSet<Symbol> Analyze(ref bool badRegion) 80Symbol variableSymbol = variable.GetSymbol(); 91protected override void NoteWrite(Symbol variable, BoundExpression value, bool read, bool isRef) 114private Symbol GetNodeSymbol(BoundNode node) 207Symbol variable = GetNodeSymbol(node); 252protected override void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration)
FlowAnalysis\DefiniteAssignment.cs (44)
59private readonly HashSet<Symbol>? initiallyAssignedVariables; 81private readonly PooledHashSet<Symbol> _writtenVariables = PooledHashSet<Symbol>.GetInstance(); 113private readonly PooledDictionary<Symbol, Location> _unsafeAddressTakenVariables = PooledDictionary<Symbol, Location>.GetInstance(); 118private readonly PooledHashSet<Symbol> _capturedVariables = PooledHashSet<Symbol>.GetInstance(); 120private readonly PooledHashSet<Symbol> _capturedInside = PooledHashSet<Symbol>.GetInstance(); 121private readonly PooledHashSet<Symbol> _capturedOutside = PooledHashSet<Symbol>.GetInstance(); 168Symbol member, 193Symbol member, 197HashSet<Symbol>? initiallyAssignedVariables = null) 215Symbol member, 219HashSet<Symbol> initiallyAssignedVariables, 234Symbol member, 283protected Symbol GetNonMemberSymbol(int slot) 343var save = CurrentSymbol; 485Symbol associatedPropertyOrEvent = field.AssociatedSymbol; 685foreach (Symbol captured in _capturedVariables) 707private void CheckCaptured(Symbol variable, ParameterSymbol? rangeVariableUnderlyingParameter = null) 710Symbol.IsCaptured(rangeVariableUnderlyingParameter ?? variable, sourceMethod)) 721private void NoteCaptured(Symbol variable) 736protected IEnumerable<Symbol> GetCapturedInside() => _capturedInside.ToArray(); 737protected IEnumerable<Symbol> GetCapturedOutside() => _capturedOutside.ToArray(); 738protected IEnumerable<Symbol> GetCaptured() => _capturedVariables.ToArray(); 739protected IEnumerable<Symbol> GetUnsafeAddressTaken() => _unsafeAddressTakenVariables.Keys.ToArray(); 744private void NotePrimaryConstructorParameterReadIfNeeded(Symbol symbol) 753Symbol variable, 849protected virtual void NoteWrite(Symbol variable, BoundExpression value, bool read, bool isRef) 1065protected override bool TryGetReceiverAndMember(BoundExpression expr, out BoundExpression receiver, out Symbol member) 1151protected void CheckAssigned(Symbol symbol, SyntaxNode node) 1170private void ReportUnassignedIfNotCapturedInLocalFunction(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration = true) 1187protected virtual void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration) 1256void addDiagnosticForStructThis(Symbol thisParameter, int thisSlot) 1308var associatedSymbol = fieldSymbol.AssociatedSymbol; 1481private Symbol UseNonFieldSymbolUnsafely(BoundExpression expression) 1805Symbol current = CurrentSymbol; 1837Symbol containing = current.ContainingSymbol; 2424var oldSymbol = this.CurrentSymbol; 2542Symbol variable = UseNonFieldSymbolUnsafely(operand); 2654foreach (var symbol in namedType.GetMembersUnordered()) 2702Symbol receiver = UseNonFieldSymbolUnsafely(node.ReceiverOpt);
FlowAnalysis\DefiniteAssignment.LocalFunctions.cs (4)
65/// in which case <see cref="LocalDataFlowPass{TLocalState, TLocalFunctionState}.VariableSlot(Symbol, int)"/> 68private void CheckIfAssignedDuringLocalFunctionReplay(Symbol symbol, SyntaxNode node, int slot) 154return !(nearestLocalFunc is null) && Symbol.IsCaptured(rootSymbol, nearestLocalFunc); 158private static LocalFunctionSymbol GetNearestLocalFunctionOpt(Symbol symbol)
FlowAnalysis\DefiniteAssignment.VariableIdentifier.cs (3)
16public readonly Symbol Symbol; 25public VariableIdentifier(Symbol symbol, int containingSlot = 0) 85return Symbol.Equals(other.Symbol, TypeCompareKind.AllIgnoreOptions);
FlowAnalysis\DefinitelyAssignedWalker.cs (12)
23private readonly HashSet<Symbol> _definitelyAssignedOnEntry = new HashSet<Symbol>(); 24private readonly HashSet<Symbol> _definitelyAssignedOnExit = new HashSet<Symbol>(); 28Symbol member, 36internal static (HashSet<Symbol> entry, HashSet<Symbol> exit) Analyze( 37CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion) 45? (new HashSet<Symbol>(), new HashSet<Symbol>()) 66private void ProcessRegion(HashSet<Symbol> definitelyAssigned) 86private void ProcessState(HashSet<Symbol> definitelyAssigned, LocalState state1, LocalState state2opt)
FlowAnalysis\EmptyStructTypeCache.cs (5)
138foreach (var member in type.OriginalDefinition.GetMembersUnordered()) 177foreach (var member in type.OriginalDefinition.GetMembersUnordered()) 191private FieldSymbol GetActualField(Symbol member, NamedTypeSymbol type) 215private bool ShouldIgnoreStructField(Symbol member, TypeSymbol memberType) 252private static bool IsAccessibleInAssembly(Symbol symbol, SourceAssemblySymbol assembly)
FlowAnalysis\EntryPointsWalker.cs (2)
23internal static IEnumerable<LabeledStatementSyntax> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, out bool? succeeded) 48private EntryPointsWalker(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion)
FlowAnalysis\ExitPointsWalker.cs (2)
23private ExitPointsWalker(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion) 41internal static ImmutableArray<StatementSyntax> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion)
FlowAnalysis\LocalDataFlowPass.cs (9)
36Symbol? member, 48Symbol member, 75protected int VariableSlot(Symbol symbol, int containingSlot = 0) 100protected virtual int GetOrCreateSlot(Symbol symbol, int containingSlot = 0, bool forceSlotEvenIfEmpty = false, bool createIfMissing = true) 161private int DescendThroughTupleRestFields(ref Symbol symbol, int containingSlot, bool forceContainingSlotsToExist) 204protected abstract bool TryGetReceiverAndMember(BoundExpression expr, out BoundExpression? receiver, [NotNullWhen(true)] out Symbol? member); 227if (TryGetReceiverAndMember(node, out BoundExpression? receiver, out Symbol? member)) 239protected int MakeMemberSlot(BoundExpression? receiverOpt, Symbol member) 262protected static bool HasInitializer(Symbol field) => field switch
FlowAnalysis\NullableWalker.cs (109)
449Symbol? symbol, 658var alreadyWarnedMembers = PooledHashSet<Symbol>.GetInstance(); 659foreach (var member in method.ContainingType.GetMembersUnordered()) 703void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member, LocalState state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis) 722Symbol symbol; 728symbol = (Symbol?)(f.AssociatedSymbol as PropertySymbol) ?? f; 789var info = new CSDiagnosticInfo(errorCode, new object[] { symbol.Kind.Localize(), symbol.Name }, ImmutableArray<Symbol>.Empty, additionalLocations: symbol.Locations); 800foreach (var member in getMembersNeedingDefaultInitialState()) 807var memberToInitialize = member; 861ImmutableArray<Symbol> getMembersNeedingDefaultInitialState() 865return ImmutableArray<Symbol>.Empty; 905static ImmutableArray<Symbol> membersToBeInitialized(NamedTypeSymbol containingType, bool includeAllMembers, bool includeCurrentTypeRequiredMembers, bool includeBaseRequiredMembers) 910=> ImmutableArray<Symbol>.Empty, 928static ImmutableArray<Symbol> getAllTypeAndRequiredMembers(TypeSymbol containingType) 931var requiredMembers = containingType.BaseTypeNoUseSiteDiagnostics?.AllRequiredMembers ?? ImmutableSegmentedDictionary<string, Symbol>.Empty; 938var builder = ArrayBuilder<Symbol>.GetInstance(members.Length + requiredMembers.Count); 949static IEnumerable<Symbol> getAllMembersToBeDefaulted(Symbol requiredMember) 965foreach (var member in property.ContainingType.GetMembers(notNullMemberName)) 973static Symbol getFieldSymbolToBeInitialized(Symbol requiredMember) 982foreach (var member in method.ContainingType.GetMembers(memberName)) 1030void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members, LocalState state, LocalState otherState) 1032foreach (var member in members) 1049foreach (var member in method.ContainingType.GetMembers(memberName)) 1058private void ReportFailedMemberNotNullIfNeeded(SyntaxNode? syntaxOpt, bool sense, Symbol member, LocalState state) 1067private bool FailsMemberNotNullExpectation(Symbol member, LocalState state) 1103foreach (var member in type.GetMembers(memberName)) 1114private int GetSlotForMemberPostCondition(Symbol member) 1403internal static VariableState? GetAfterInitializersState(CSharpCompilation compilation, Symbol? symbol, BoundNode constructorBody) 1473Symbol? symbol, 1488Symbol? symbol, 1495ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols) 1504Symbol? symbol, 1567ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols) 1572var symbol = variables.Symbol; 1608private static BoundNode Rewrite(ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)> updatedNullabilities, SnapshotManager? snapshotManager, BoundNode node, ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols) 1610var remappedSymbolsBuilder = ImmutableDictionary.CreateBuilder<Symbol, Symbol>(Symbols.SymbolEqualityComparer.ConsiderEverything, Symbols.SymbolEqualityComparer.ConsiderEverything); 1719Symbol? symbol, 1771Symbol? symbol, 1804private void RecordNullableAnalysisData(Symbol? symbol, bool requiredAnalysis) 1831private void SetUpdatedSymbol(BoundNode node, Symbol originalSymbol, Symbol updatedSymbol) 1854if (lambdaIsExactMatch || Symbol.Equals(originalSymbol, updatedSymbol, TypeCompareKind.ConsiderEverything)) 1906var symbol = variable.Symbol; 1939protected override bool TryGetReceiverAndMember(BoundExpression expr, out BoundExpression? receiver, [NotNullWhen(true)] out Symbol? member) 2107var container = method.ContainingSymbol; 2118protected override int GetOrCreateSlot(Symbol symbol, int containingSlot = 0, bool forceSlotEvenIfEmpty = false, bool createIfMissing = true) 2242var containingSymbol = parameterOpt?.ContainingSymbol; 2609private bool IsSlotMember(int slot, Symbol possibleMember) 2621private void InheritNullableStateOfMember(int targetContainerSlot, int valueContainerSlot, Symbol member, bool isDefaultValue, int skipSlot) 2731var symbol = AsMemberOfType(targetType, variable.Symbol); 2738private NullableFlowState GetDefaultState(Symbol symbol) 3173if (Symbol.IsCaptured(variables[slot].Symbol, localFunc)) 3192var symbol = variables[variables.RootSlot(slot)].Symbol; 3193if (Symbol.IsCaptured(symbol, localFunc)) 3239var oldSymbol = this._symbol; 3241var oldCurrentSymbol = this.CurrentSymbol; 3592private static bool AreCloseEnough(Symbol original, Symbol updated) 4112Symbol? symbol = getTargetMember(containingType, objectInitializer); 4128Action<int, Symbol>? initializationCompletion = null; 4152Action<int, Symbol>? initializationCompletion, 4174Action<int, Symbol>? initializationCompletion) 4178Symbol? symbol = getTargetMember(containingType, (BoundObjectInitializerMember)node.Left); 4190static Symbol? getTargetMember(TypeSymbol containingType, BoundObjectInitializerMember objectInitializer) 4192var symbol = objectInitializer.MemberSymbol; 4203int getOrCreateSlot(int containingSlot, Symbol symbol) 4208Action<int, Symbol>? visitNestedInitializer(int containingSlot, TypeSymbol containingType, Symbol symbol, BoundObjectInitializerExpressionBase initializer, bool delayCompletionForType) 4218Action<int, Symbol>? completeNestedInitializerAnalysis( 4219Symbol symbol, BoundObjectInitializerExpressionBase initializer, int slot, Action<int, TypeSymbol>? nestedCompletion, 4240Action<int, Symbol>? completeNestedInitializerAnalysisAsContinuation(BoundObjectInitializerExpressionBase initializer, Action<int, TypeSymbol>? nestedCompletion) 4242return (int containingSlot, Symbol symbol) => 4250Action<int, Symbol>? visitMemberAssignment(BoundAssignmentOperator node, int containingSlot, Symbol symbol, bool delayCompletionForType, Func<TypeWithAnnotations, TypeWithState>? conversionCompletion = null) 4283Action<int, Symbol>? visitMemberAssignmentAsContinuation(BoundAssignmentOperator node, Func<TypeWithAnnotations, TypeWithState> conversionCompletion) 4285return (int containingSlot, Symbol symbol) => 5475foreach (var member in getMembers(expressionType)) 5492static IEnumerable<Symbol> getMembers(TypeSymbol type) 5495foreach (var member in type.GetMembers()) 5500foreach (var member in baseType.GetMembers()) 5505foreach (var member in interfaceType.GetMembers()) 6378var implementationMethod = baseType.FindImplementationForInterfaceMember(constructedMethod); 6575private FlowAnalysisAnnotations GetRValueAnnotations(Symbol? symbol) 7185foreach (Symbol member in type.GetMembers(memberName)) 8168private static Symbol AsMemberOfType(TypeSymbol? type, Symbol symbol) 8213if (tryAsMemberOfSingleType(containingType, out var result)) 8229if (tryAsMemberOfSingleType(containingType, out var result)) 8243bool tryAsMemberOfSingleType(NamedTypeSymbol singleType, [NotNullWhen(true)] out Symbol? result) 8250var symbolDef = symbol.OriginalDefinition; 8513int targetSlot = GetNullableOfTValueSlot(containingType, containingSlot, out Symbol? symbol); 10053private FlowAnalysisAnnotations GetObjectInitializerMemberLValueAnnotations(Symbol memberSymbol) 10657var updatedSymbol = VisitMemberAccess(node, node.ReceiverOpt, node.FieldSymbol); 10667var updatedMember = VisitMemberAccess(node, node.ReceiverOpt, property); 10750var updatedSymbol = VisitMemberAccess(node, node.ReceiverOpt, node.EventSymbol); 10755private Symbol VisitMemberAccess(BoundExpression node, BoundExpression? receiverOpt, Symbol member) 10803private SpecialMember? GetNullableOfTMember(Symbol member) 10823private int GetNullableOfTValueSlot(TypeSymbol containingType, int containingSlot, out Symbol? valueProperty, bool forceSlotEvenIfEmpty = false) 12667private sealed class ExpressionAndSymbolEqualityComparer : IEqualityComparer<(BoundNode? expr, Symbol symbol)> 12673public bool Equals((BoundNode? expr, Symbol symbol) x, (BoundNode? expr, Symbol symbol) y) 12684public int GetHashCode((BoundNode? expr, Symbol symbol) obj)
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (4)
24private readonly Symbol _containingSymbol; 28public PlaceholderLocal(Symbol containingSymbol, object identifier, TypeWithAnnotations type) 37public override bool Equals(Symbol obj, TypeCompareKind compareKind) 49public override Symbol ContainingSymbol => _containingSymbol;
FlowAnalysis\NullableWalker.SnapshotManager.cs (19)
31private readonly ImmutableDictionary<(BoundNode?, Symbol), Symbol> _updatedSymbolsMap; 35private SnapshotManager(ImmutableArray<SharedWalkerState> walkerSharedStates, ImmutableArray<(int position, Snapshot snapshot)> incrementalSnapshots, ImmutableDictionary<(BoundNode?, Symbol), Symbol> updatedSymbolsMap) 74if (_updatedSymbolsMap.TryGetValue((null, lambda), out var updatedDelegate)) 82internal bool TryGetUpdatedSymbol(BoundNode node, Symbol symbol, [NotNullWhen(true)] out Symbol? updatedSymbol) 148private readonly ImmutableDictionary<(BoundNode?, Symbol), Symbol>.Builder _updatedSymbolMap = ImmutableDictionary.CreateBuilder<(BoundNode?, Symbol), Symbol>(ExpressionAndSymbolEqualityComparer.Instance, Symbols.SymbolEqualityComparer.ConsiderEverything); 166private readonly PooledDictionary<Symbol, int> _symbolToSlot = PooledDictionary<Symbol, int>.GetInstance(); 181internal int EnterNewWalker(Symbol symbol) 220internal void SetUpdatedSymbol(BoundNode node, Symbol originalSymbol, Symbol updatedSymbol) 228internal void RemoveSymbolIfPresent(BoundNode node, Symbol symbol) 233private static (BoundNode?, Symbol) GetKey(BoundNode node, Symbol symbol)
FlowAnalysis\NullableWalker.Variables.cs (13)
38internal readonly Symbol? Symbol; 48internal readonly ImmutableDictionary<Symbol, TypeWithAnnotations> VariableTypes; 50internal VariablesSnapshot(int id, VariablesSnapshot? container, Symbol? symbol, ImmutableArray<KeyValuePair<VariableIdentifier, int>> variableSlot, ImmutableDictionary<Symbol, TypeWithAnnotations> variableTypes) 59internal bool TryGetType(Symbol symbol, out TypeWithAnnotations type) 118internal readonly Symbol? Symbol; 128private readonly PooledDictionary<Symbol, TypeWithAnnotations> _variableTypes = SpecializedSymbolCollections.GetPooledSymbolDictionaryInstance<Symbol, TypeWithAnnotations>(); 140internal static Variables Create(Symbol? symbol) 183private Variables(int id, Variables? container, Symbol? symbol) 297internal bool TryGetType(Symbol symbol, out TypeWithAnnotations type) 303internal void SetType(Symbol symbol, TypeWithAnnotations type) 353private Variables GetVariablesContainingSymbol(Symbol symbol)
FlowAnalysis\ReadWriteWalker.cs (25)
22CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, HashSet<PrefixUnaryExpressionSyntax> unassignedVariableAddressOfSyntaxes, 23out IEnumerable<Symbol> readInside, 24out IEnumerable<Symbol> writtenInside, 25out IEnumerable<Symbol> readOutside, 26out IEnumerable<Symbol> writtenOutside, 27out IEnumerable<Symbol> captured, 28out IEnumerable<Symbol> unsafeAddressTaken, 29out IEnumerable<Symbol> capturedInside, 30out IEnumerable<Symbol> capturedOutside, 40readInside = writtenInside = readOutside = writtenOutside = captured = unsafeAddressTaken = capturedInside = capturedOutside = Enumerable.Empty<Symbol>(); 65private readonly HashSet<Symbol> _readInside = new HashSet<Symbol>(); 66private readonly HashSet<Symbol> _writtenInside = new HashSet<Symbol>(); 67private readonly HashSet<Symbol> _readOutside = new HashSet<Symbol>(); 68private readonly HashSet<Symbol> _writtenOutside = new HashSet<Symbol>(); 70private ReadWriteWalker(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, 78Symbol current = CurrentSymbol; 102Symbol containing = current.ContainingSymbol; 125protected override void NoteRead(Symbol variable, ParameterSymbol rangeVariableUnderlyingParameter = null) 132protected override void NoteWrite(Symbol variable, BoundExpression value, bool read, bool isRef) 170private void NoteReceiverReadOrWritten(BoundFieldAccess expr, HashSet<Symbol> readOrWritten) 178private void NoteExpressionReadOrWritten(BoundExpression receiver, HashSet<Symbol> readOrWritten)
FlowAnalysis\RegionAnalysisContext.cs (2)
23public readonly Symbol Member; 34public RegionAnalysisContext(CSharpCompilation compilation, Symbol member, BoundNode boundNode, BoundNode firstInRegion, BoundNode lastInRegion)
FlowAnalysis\RegionReachableWalker.cs (2)
17internal static void Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, 39private RegionReachableWalker(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion)
FlowAnalysis\UnassignedAddressTakenVariablesWalker.cs (3)
18private UnassignedAddressTakenVariablesWalker(CSharpCompilation compilation, Symbol member, BoundNode node) 23internal static HashSet<PrefixUnaryExpressionSyntax> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node) 52protected override void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration)
FlowAnalysis\UnassignedVariablesWalker.cs (8)
21private UnassignedVariablesWalker(CSharpCompilation compilation, Symbol member, BoundNode node) 26internal static HashSet<Symbol> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, 40return badRegion ? new HashSet<Symbol>() : result; 48private readonly HashSet<Symbol> _result = new HashSet<Symbol>(); 50private HashSet<Symbol> Analyze(ref bool badRegion) 56protected override void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration)
FlowAnalysis\VariablesDeclaredWalker.cs (6)
22internal static IEnumerable<Symbol> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion) 29return badRegion ? SpecializedCollections.EmptyEnumerable<Symbol>() : walker._variablesDeclared; 37private HashSet<Symbol> _variablesDeclared = new HashSet<Symbol>(); 39internal VariablesDeclaredWalker(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion)
Generated\BoundNodes.xml.Generated.cs (53)
530public BoundDeconstructValuePlaceholder(SyntaxNode syntax, Symbol? variableSymbol, bool isDiscardExpression, TypeSymbol type, bool hasErrors) 540public BoundDeconstructValuePlaceholder(SyntaxNode syntax, Symbol? variableSymbol, bool isDiscardExpression, TypeSymbol type) 551public Symbol? VariableSymbol { get; } 557public BoundDeconstructValuePlaceholder Update(Symbol? variableSymbol, bool isDiscardExpression, TypeSymbol type) 980public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type, bool hasErrors = false) 993public ImmutableArray<Symbol?> Symbols { get; } 999public BoundBadExpression Update(LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type) 6075public BoundMethodGroup(SyntaxNode syntax, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, ImmutableArray<MethodSymbol> methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, FunctionTypeSymbol? functionType, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false) 6094public Symbol? LookupSymbolOpt { get; } 6102public BoundMethodGroup Update(ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, ImmutableArray<MethodSymbol> methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, FunctionTypeSymbol? functionType, BoundExpression? receiverOpt, LookupResultKind resultKind) 6744public BoundObjectInitializerMember(SyntaxNode syntax, Symbol? memberSymbol, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, AccessorKind accessorKind, TypeSymbol receiverType, TypeSymbol type, bool hasErrors = false) 6765public Symbol? MemberSymbol { get; } 6779public BoundObjectInitializerMember Update(Symbol? memberSymbol, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, AccessorKind accessorKind, TypeSymbol receiverType, TypeSymbol type) 8087protected BoundObjectPattern(BoundKind kind, SyntaxNode syntax, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8098public Symbol? Variable { get; } 8104public BoundDeclarationPattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8122public BoundDeclarationPattern Update(BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8136public BoundRecursivePattern(SyntaxNode syntax, BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8159public BoundRecursivePattern Update(BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8173public BoundListPattern(SyntaxNode syntax, ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8203public BoundListPattern Update(ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8306public BoundPositionalSubpattern(SyntaxNode syntax, Symbol? symbol, BoundPattern pattern, bool hasErrors = false) 8315public Symbol? Symbol { get; } 8320public BoundPositionalSubpattern Update(Symbol? symbol, BoundPattern pattern) 8364public BoundPropertySubpatternMember(SyntaxNode syntax, BoundPropertySubpatternMember? receiver, Symbol? symbol, TypeSymbol type, bool hasErrors = false) 8376public Symbol? Symbol { get; } 8382public BoundPropertySubpatternMember Update(BoundPropertySubpatternMember? receiver, Symbol? symbol, TypeSymbol type) 8591protected VariablePendingInference(BoundKind kind, SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false) 8602public Symbol VariableSymbol { get; } 8608public OutVariablePendingInference(SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false) 8620public OutVariablePendingInference Update(Symbol variableSymbol, BoundExpression? receiverOpt) 8634public DeconstructionVariablePendingInference(SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false) 8646public DeconstructionVariablePendingInference Update(Symbol variableSymbol, BoundExpression? receiverOpt) 8660public OutDeconstructVarPendingInference(SyntaxNode syntax, Symbol? variableSymbol, bool isDiscardExpression, bool hasErrors) 8667public OutDeconstructVarPendingInference(SyntaxNode syntax, Symbol? variableSymbol, bool isDiscardExpression) 8675public Symbol? VariableSymbol { get; } 8681public OutDeconstructVarPendingInference Update(Symbol? variableSymbol, bool isDiscardExpression) 12220private readonly ImmutableDictionary<Symbol, Symbol>.Builder _remappedSymbols; 12222public NullabilityRewriter(ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> updatedNullabilities, NullableWalker.SnapshotManager? snapshotManager, ImmutableDictionary<Symbol, Symbol>.Builder remappedSymbols) 12284Symbol? variableSymbol = GetUpdatedSymbol(node, node.VariableSymbol); 12450ImmutableArray<Symbol?> symbols = GetUpdatedArray(node, node.Symbols); 13894Symbol? lookupSymbolOpt = GetUpdatedSymbol(node, node.LookupSymbolOpt); 14167Symbol? memberSymbol = GetUpdatedSymbol(node, node.MemberSymbol); 14728Symbol? variable = GetUpdatedSymbol(node, node.Variable); 14739Symbol? variable = GetUpdatedSymbol(node, node.Variable); 14751Symbol? variable = GetUpdatedSymbol(node, node.Variable); 14786Symbol? symbol = GetUpdatedSymbol(node, node.Symbol); 14793Symbol? symbol = GetUpdatedSymbol(node, node.Symbol); 14862Symbol variableSymbol = GetUpdatedSymbol(node, node.VariableSymbol); 14880Symbol variableSymbol = GetUpdatedSymbol(node, node.VariableSymbol); 14898Symbol? variableSymbol = GetUpdatedSymbol(node, node.VariableSymbol);
Lowering\AsyncRewriter\AsyncIteratorMethodToStateMachineRewriter.cs (2)
56IReadOnlySet<Symbol> hoistedVariables, 57IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> nonReusableLocalProxies,
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (4)
426where TSymbol : Symbol 438var sym = CSharpCompilation.GetRuntimeMember( 477foreach (var member in members) 505foreach (var member in members)
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (2)
74IReadOnlySet<Symbol> hoistedVariables, 75IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> nonReusableLocalProxies,
Lowering\AsyncRewriter\AsyncRewriter.AsyncIteratorRewriter.cs (1)
262protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies)
Lowering\AsyncRewriter\AsyncRewriter.cs (2)
130private Symbol EnsureWellKnownMember(WellKnownMember member, BindingDiagnosticBag bag) 214protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies)
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (1)
566public static Scope GetVariableDeclarationScope(Scope startingScope, Symbol variable)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (17)
53public readonly SetWithInsertionOrder<Symbol> DeclaredVariables = new SetWithInsertionOrder<Symbol>(); 134public readonly PooledHashSet<Symbol> CapturedVariables = PooledHashSet<Symbol>.GetInstance(); 177public readonly SetWithInsertionOrder<Symbol> CapturedVariables; 187public ClosureEnvironment(IEnumerable<Symbol> capturedVariables, bool isStruct) 189CapturedVariables = new SetWithInsertionOrder<Symbol>(); 190foreach (var item in capturedVariables) 307private readonly SmallDictionary<Symbol, Scope> _localToScope = new SmallDictionary<Symbol, Scope>(); 321private readonly HashSet<Symbol> _freeVariables = new HashSet<Symbol>(); 394DeclareLocals(_currentScope, ImmutableArray.Create<Symbol>(thisParam)); 606private void AddIfCaptured(Symbol symbol, SyntaxNode syntax) 680private void AddDiagnosticIfRestrictedType(Symbol capturedVariable, SyntaxNode syntax) 711where TSymbol : Symbol 787where TSymbol : Symbol
Lowering\ClosureConversion\ClosureConversion.cs (12)
92private readonly Dictionary<NamedTypeSymbol, Symbol> _framePointers = new Dictionary<NamedTypeSymbol, Symbol>(); 112private Symbol _innermostFramePointer; 147/// This should only be used by <see cref="NeedsProxy(Symbol)"/> which 152private readonly ImmutableHashSet<Symbol> _allCapturedVariables; 192var allCapturedVars = ImmutableHashSet.CreateBuilder<Symbol>(); 200protected override bool NeedsProxy(Symbol localOrParameter) 618Symbol framePointer = _framePointers[frameClass]; 716Symbol oldInnermostFramePointer = _innermostFramePointer; 744private void InitVariableProxy(SyntaxNode syntax, Symbol symbol, LocalSymbol framePointer, ArrayBuilder<BoundExpression> prologue) 1560var oldInnermostFramePointer = _innermostFramePointer; 1731return new BoundBadExpression(F.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (8)
351return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), ExpressionType); 382return new BoundBadExpression(node.Syntax, 0, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), ExpressionType); 909private BoundExpression InitializerMemberSetter(Symbol symbol) 924private BoundExpression InitializerMemberGetter(Symbol symbol) 951var sym = ((BoundObjectInitializerMember)a.Left).MemberSymbol; 1091return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type); 1098return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type); 1130return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (4)
42public static LambdaCapturedVariable Create(SynthesizedClosureEnvironment frame, Symbol captured, ref int uniqueId) 51private static bool IsThis(Symbol captured) 57private static string GetCapturedVariableFieldName(Symbol variable, ref int uniqueId) 97private static TypeSymbol GetCapturedVariableFieldType(SynthesizedContainer frame, Symbol variable)
Lowering\ClosureConversion\SynthesizedClosureEnvironment.cs (5)
35private ArrayBuilder<Symbol> _membersBuilder = ArrayBuilder<Symbol>.GetInstance(); 36private ImmutableArray<Symbol> _members; 109public override ImmutableArray<Symbol> GetMembers() 139public override Symbol ContainingSymbol => TopLevelMethod.ContainingSymbol;
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
206private void CheckReferenceToVariable(BoundExpression node, Symbol symbol) 210if (_staticLocalOrAnonymousFunction is object && Symbol.IsCaptured(symbol, _staticLocalOrAnonymousFunction))
Lowering\DiagnosticsPass_Warnings.cs (4)
21private void CheckArguments(ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<BoundExpression> arguments, Symbol method) 56private void CheckFieldAddress(BoundFieldAccess fieldAccess, Symbol consumerOpt) 151private bool IsInterlockedAPI(Symbol method) 365foreach (var sym in t.GetMembers(opName))
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (6)
204private MethodSymbol? GetLocalOrParameterStoreLogger(TypeSymbol variableType, Symbol targetSymbol, bool? refAssignmentSourceIsLocal, SyntaxNode syntax) 388if (!TryGetLocalOrParameterInfo(original.Left, out var targetSymbol, out var targetType, out var targetIndex)) 409private bool TryGetLocalOrParameterInfo(BoundNode node, [NotNullWhen(true)] out Symbol? symbol, [NotNullWhen(true)] out TypeSymbol? type, [NotNullWhen(true)] out BoundExpression? indexExpression) 437Symbol targetSymbol, 485private BoundExpression VariableRead(Symbol localOrParameterSymbol) 583if (!TryGetLocalOrParameterInfo(arguments[i], out var targetSymbol, out var targetType, out var targetIndex))
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (1)
166foreach (var member in methodDefinition.ContainingType.GetMembers(method.Name))
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (2)
179public override Symbol AssociatedSymbol 199public override Symbol ContainingSymbol
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (2)
62IReadOnlySet<Symbol> hoistedVariables, 63IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> nonReusableLocalProxies,
Lowering\IteratorRewriter\IteratorRewriter.cs (3)
139private Symbol EnsureSpecialMember(SpecialMember member, BindingDiagnosticBag bag) 141Symbol symbol; 312protected override BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies)
Lowering\LocalRewriter\DelegateCacheContainer.cs (2)
16private readonly Symbol _containingSymbol; 40public override Symbol ContainingSymbol => _containingSymbol;
Lowering\LocalRewriter\DelegateCacheRewriter.cs (2)
142for (Symbol? enclosingSymbol = currentFunction; enclosingSymbol is MethodSymbol enclosingMethod; enclosingSymbol = enclosingSymbol.ContainingSymbol) 176for (Symbol? enclosingSymbol = currentFunction; enclosingSymbol is MethodSymbol enclosingMethod; enclosingSymbol = enclosingSymbol.ContainingSymbol)
Lowering\LocalRewriter\DynamicSiteContainer.cs (1)
24public override Symbol ContainingSymbol
Lowering\LocalRewriter\LocalRewriter.cs (2)
593return new BoundBadExpression(syntax, LookupResultKind.NotReferencable, ImmutableArray<Symbol?>.Empty, children, resultType); 596private bool TryGetWellKnownTypeMember<TSymbol>(SyntaxNode? syntax, WellKnownMember member, [NotNullWhen(true)] out TSymbol? symbol, bool isOptional = false, Location? location = null) where TSymbol : Symbol
Lowering\LocalRewriter\LocalRewriter_Call.cs (3)
657Symbol methodOrIndexer, 999Symbol methodOrIndexer, 1211Symbol methodOrIndexer,
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (2)
161private BoundExpression? TransformPropertyOrEventReceiver(Symbol propertyOrEvent, BoundExpression? receiverOpt, bool isRegularCompoundAssignment, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps) 459private bool TransformCompoundAssignmentFieldOrEventAccessReceiver(Symbol fieldOrEvent, ref BoundExpression? receiver, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps)
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (4)
112PooledHashSet<Symbol>? visitedSymbols = null; 152static bool canReorderTargetAssignments(ArrayBuilder<Binder.DeconstructionVariable> targets, ref PooledHashSet<Symbol>? visitedSymbols) 165Symbol? symbol; 184visitedSymbols ??= PooledHashSet<Symbol>.GetInstance();
Lowering\LocalRewriter\LocalRewriter_Event.cs (5)
128clearCall = new BoundBadExpression(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(removeDelegate), ErrorTypeSymbol.UnknownResultType); 170marshalCall = new BoundBadExpression(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, marshalArguments, ErrorTypeSymbol.UnknownResultType); 265getOrCreateCall = new BoundBadExpression(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(fieldAccess), ErrorTypeSymbol.UnknownResultType); 287return new BoundBadExpression(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(getOrCreateCall), ErrorTypeSymbol.UnknownResultType); 333return new BoundBadExpression(node.Syntax, LookupResultKind.NotCreatable, ImmutableArray.Create<Symbol?>(node.Event),
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (2)
483helperCall = new BoundBadExpression(fixedInitializer.Syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType); 544lengthCall = new BoundBadExpression(fixedInitializer.Syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(factory.Local(pinnedTemp)), ErrorTypeSymbol.UnknownResultType);
Lowering\LocalRewriter\LocalRewriter_Literal.cs (1)
76Symbol? useField = null;
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (2)
117exitCallExpr = new BoundBadExpression(lockSyntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(boundLockTemp), ErrorTypeSymbol.UnknownResultType); 212enterCallExpr = new BoundBadExpression(lockSyntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(boundLockTemp), ErrorTypeSymbol.UnknownResultType);
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (4)
217var property = left.MemberSymbol; 389newGuid = new BoundBadExpression(node.Syntax, LookupResultKind.NotCreatable, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType); 407callGetTypeFromCLSID = new BoundBadExpression(node.Syntax, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType); 419rewrittenObjectCreation = new BoundBadExpression(node.Syntax, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, node.Type);
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
662var memberSymbol = rewrittenLeft.MemberSymbol;
Lowering\LocalRewriter\LocalRewriter_StackAlloc.cs (1)
70symbols: ImmutableArray<Symbol?>.Empty,
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
667foreach (var member in typeToStringMembers)
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
228: new BoundBadExpression(syntax, LookupResultKind.Empty, symbols: ImmutableArray<Symbol?>.Empty, childBoundNodes: ImmutableArray<BoundExpression>.Empty, type);
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (1)
463disposeCall = new BoundBadExpression(resourceSyntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(disposedExpression), ErrorTypeSymbol.UnknownResultType);
Lowering\LocalRewriter\LoweredDynamicOperation.cs (1)
55var bad = new BoundBadExpression(children[0].Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, children, resultType);
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
526var binderFactory = _factory.WellKnownMember(factoryMethod);
Lowering\MethodToClassRewriter.cs (8)
28protected Dictionary<Symbol, CapturedSymbolReplacement> proxies = new Dictionary<Symbol, CapturedSymbolReplacement>(); 78protected abstract bool NeedsProxy(Symbol localOrParameter); 372private bool TryReplaceWithProxy(Symbol parameterOrLocal, SyntaxNode syntax, [NotNullWhen(true)] out BoundNode? replacement) 427private bool TryGetHoistedField(Symbol variable, [NotNullWhen(true)] out FieldSymbol? field) 634foreach (var member in newType.GetMembers(method.Name)) 677foreach (var member in newType.GetMembers(property.Name)) 701var member = node.MemberSymbol;
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (14)
30private readonly OrderedSet<Symbol> _variablesToHoist = new OrderedSet<Symbol>(); 34private MultiDictionary<Symbol, SyntaxNode> _lazyDisallowedCaptures; 42private IteratorAndAsyncCaptureWalker(CSharpCompilation compilation, MethodSymbol method, BoundNode node, HashSet<Symbol> initiallyAssignedVariables) 53public static OrderedSet<Symbol> Analyze(CSharpCompilation compilation, MethodSymbol method, BoundNode node, DiagnosticBag diagnostics) 113var variablesToHoist = new OrderedSet<Symbol>(); 136private static bool HoistInDebugBuild(Symbol symbol) 209private void CaptureVariable(Symbol variable, SyntaxNode syntax) 215(_lazyDisallowedCaptures ??= new MultiDictionary<Symbol, SyntaxNode>()).Add(variable, syntax); 258protected override void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration) 348private readonly HashSet<Symbol> _localsInScope; 358_localsInScope = new HashSet<Symbol>(); 387private void AddVariable(Symbol local) 422private void Capture(Symbol s, SyntaxNode syntax)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (5)
86private readonly IReadOnlySet<Symbol> _hoistedVariables; 105IReadOnlySet<Symbol> hoistedVariables, 106IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> nonReusableLocalProxies, 175protected override bool NeedsProxy(Symbol localOrParameter) 196internal IReadOnlySet<Symbol> HoistedVariables
Lowering\StateMachineRewriter\StateMachineRewriter.cs (10)
30protected IReadOnlyDictionary<Symbol, CapturedSymbolReplacement>? nonReusableLocalProxies; 33protected IOrderedReadOnlySet<Symbol>? hoistedVariables; 34protected Dictionary<Symbol, CapturedSymbolReplacement>? initialParameters; 86protected abstract BoundStatement GenerateStateMachineCreation(LocalSymbol stateMachineVariable, NamedTypeSymbol frameType, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies); 114initialParameters = new Dictionary<Symbol, CapturedSymbolReplacement>(); 137IEnumerable<Symbol> variablesToHoist, 138out IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies, 142var proxiesBuilder = new Dictionary<Symbol, CapturedSymbolReplacement>(); 151foreach (var variable in variablesToHoist) 306protected BoundStatement GenerateParameterStorage(LocalSymbol stateMachineVariable, IReadOnlyDictionary<Symbol, CapturedSymbolReplacement> proxies)
Lowering\StateMachineRewriter\StateMachineTypeSymbol.cs (1)
34public override Symbol ContainingSymbol
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.cs (1)
104public override Symbol ContainingSymbol
Lowering\SyntheticBoundNodeFactory.cs (9)
233return new BoundBadExpression(Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, type, hasErrors: true); 315public Symbol? WellKnownMember(WellKnownMember wm, bool isOptional) 317Symbol? wellKnownMember = Binder.GetWellKnownTypeMember(Compilation, wm, Diagnostics, syntax: Syntax, isOptional: true); 328public Symbol WellKnownMember(WellKnownMember wm) 350public Symbol SpecialMember(SpecialMember sm) 352var result = SpecialMember(sm, isOptional: false); 357public Symbol? SpecialMember(SpecialMember sm, bool isOptional = false) 359Symbol specialMember = Compilation.GetSpecialTypeMember(sm); 789return new BoundBadExpression(Syntax, default(LookupResultKind), ImmutableArray<Symbol?>.Empty, args.AsImmutable(), receiver);
Operations\CSharpOperationFactory.cs (3)
461private static TypeParameterSymbol? GetConstrainedToType(Symbol targetMember, BoundExpression? receiverOpt) 851Symbol? memberSymbol = boundObjectInitializerMember.MemberSymbol; 2892IPropertySubpatternOperation createPropertySubpattern(Symbol? symbol, IPatternOperation pattern, ITypeSymbol receiverType, SyntaxNode nameSyntax, bool isSingle)
Operations\CSharpOperationFactory_Methods.cs (4)
98internal IOperation? CreateReceiverOperation(BoundNode? instance, Symbol? symbol) 265Symbol methodOrIndexer, 291Symbol methodOrIndexer, 361Symbol methodOrIndexer,
Symbols\AliasSymbol.cs (6)
53private readonly Symbol _containingSymbol; 55protected AliasSymbol(string aliasName, Symbol containingSymbol, ImmutableArray<Location> locations, bool isExtern) 73internal static AliasSymbol CreateCustomDebugInfoAlias(NamespaceOrTypeSymbol targetSymbol, SyntaxToken aliasToken, Symbol containingSymbol, bool isExtern) 206public sealed override Symbol ContainingSymbol 243public override bool Equals(Symbol? obj, TypeCompareKind compareKind) 436internal AliasSymbolFromResolvedTarget(NamespaceOrTypeSymbol target, string aliasName, Symbol containingSymbol, ImmutableArray<Location> locations, bool isExtern)
Symbols\AnonymousTypes\AnonymousTypeManager.SymbolCollection.cs (3)
64private static void ReportErrorOnSymbol(Symbol symbol, BindingDiagnosticBag diagnostics, ref bool hasError) 74private static void ReportErrorOnSpecialMember(Symbol symbol, SpecialMember member, BindingDiagnosticBag diagnostics, ref bool hasError) 89private static void ReportErrorOnWellKnownMember(Symbol symbol, WellKnownMember member, BindingDiagnosticBag diagnostics, ref bool hasError)
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (6)
388var xOwner = x.ContainingSymbol; 389var yOwner = y.ContainingSymbol; 405static bool isContainedIn(Symbol symbol, Symbol container) 407var other = symbol.ContainingSymbol; 782foreach (var member in ((NamedTypeSymbol)translatedType.OriginalDefinition).GetMembers(method.Name))
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (3)
47internal sealed override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() 52internal sealed override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) 57public sealed override Symbol ContainingSymbol
Symbols\AnonymousTypes\PublicSymbols\AnonymousType.DelegatePublicSymbol.cs (5)
17private ImmutableArray<Symbol> _lazyMembers; 43public override ImmutableArray<Symbol> GetMembers() 52private ImmutableArray<Symbol> CreateMembers() 68return ImmutableArray.Create<Symbol>(constructor, invokeMethod); 71public override ImmutableArray<Symbol> GetMembers(string name) => GetMembers().WhereAsArray((member, name) => member.Name == name, name);
Symbols\AnonymousTypes\PublicSymbols\AnonymousType.TypePublicSymbol.cs (8)
23private readonly ImmutableArray<Symbol> _members; 29private readonly MultiDictionary<string, Symbol> _nameToSymbols = new MultiDictionary<string, Symbol>(); 41var members = ArrayBuilder<Symbol>.GetInstance(membersCount); 58foreach (var symbol in _members) 85public override ImmutableArray<Symbol> GetMembers() 90public override ImmutableArray<Symbol> GetMembers(string name) 93var builder = ArrayBuilder<Symbol>.GetInstance(symbols.Count);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (5)
18private readonly ImmutableArray<Symbol> _members; 215private static ImmutableArray<Symbol> CreateMembers(MethodSymbol constructor, MethodSymbol invokeMethod) 216=> ImmutableArray.Create<Symbol>(constructor, invokeMethod); 232public override ImmutableArray<Symbol> GetMembers() => _members; 234public override ImmutableArray<Symbol> GetMembers(string name) => GetMembers().WhereAsArray((member, name) => member.Name == name, name);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (2)
72public override Symbol AssociatedSymbol 105public override Symbol ContainingSymbol
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertyAccessorSymbol.cs (1)
54public override Symbol AssociatedSymbol
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (2)
166public override Symbol ContainingSymbol 206public override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (2)
41public sealed override Symbol ContainingSymbol 138public override Symbol AssociatedSymbol
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (9)
27private readonly ImmutableArray<Symbol> _members; 37private readonly MultiDictionary<string, Symbol> _nameToSymbols = new MultiDictionary<string, Symbol>(); 48var membersBuilder = ArrayBuilder<Symbol>.GetInstance(membersCount); 81foreach (var symbol in _members) 108public override ImmutableArray<Symbol> GetMembers() 115foreach (var m in this.GetMembers()) 126public override ImmutableArray<Symbol> GetMembers(string name) 129var builder = ArrayBuilder<Symbol>.GetInstance(symbols.Count);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeOrDelegateTemplateSymbol.cs (3)
125internal sealed override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() 130internal sealed override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) 135public sealed override Symbol ContainingSymbol
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeParameterSymbol.cs (1)
127public override Symbol ContainingSymbol
Symbols\ArrayTypeSymbol.cs (6)
261public override ImmutableArray<Symbol> GetMembers() 263return ImmutableArray<Symbol>.Empty; 266public override ImmutableArray<Symbol> GetMembers(string name) 268return ImmutableArray<Symbol>.Empty; 302public override Symbol? ContainingSymbol 463internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\AssemblySymbol.cs (3)
300public sealed override Symbol ContainingSymbol 1059internal virtual Symbol GetDeclaredSpecialTypeMember(SpecialMember member) 1067internal virtual Symbol GetSpecialTypeMember(SpecialMember member)
Symbols\Attributes\AttributeData.cs (6)
215internal void DecodeSecurityAttribute<T>(Symbol targetSymbol, CSharpCompilation compilation, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 290foreach (Symbol foundMember in type.GetMembers(memberName)) 339private DeclarativeSecurityAction DecodeSecurityAttributeAction(Symbol targetSymbol, CSharpCompilation compilation, AttributeSyntax? nodeOpt, out bool hasErrors, BindingDiagnosticBag diagnostics) 382private DeclarativeSecurityAction DecodeSecurityAction(TypedConstant typedValue, Symbol targetSymbol, AttributeSyntax? nodeOpt, BindingDiagnosticBag diagnostics, out bool hasErrors) 653foreach (var member in AttributeClass.GetMembers(memberName)) 672internal bool ShouldEmitAttribute(Symbol target, bool isReturnType, bool emittingAssemblyAttributesInNetModule)
Symbols\BaseTypeAnalysis.cs (6)
24var hs = PooledHashSet<Symbol>.GetInstance(); 33private static void TypeDependsClosure(NamedTypeSymbol type, CSharpCompilation currentCompilation, HashSet<Symbol> partialClosure) 114foreach (var member in type.GetMembersUnordered()) 153var hs = PooledHashSet<Symbol>.GetInstance(); 173static (bool definitelyManaged, bool hasGenerics) dependsOnDefinitelyManagedType(NamedTypeSymbol type, HashSet<Symbol> partialClosure, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 180foreach (var member in type.GetInstanceFieldsAndEvents())
Symbols\Compilation_UsedAssemblies.cs (1)
39Symbol? symbol = GetBoundReferenceManager().GetReferencedAssemblySymbol(reference);
Symbols\Compilation_WellKnownMembers.cs (12)
32private Symbol?[]? _lazyWellKnownTypeMembers; 77internal Symbol? GetWellKnownTypeMember(WellKnownMember member) 88var wellKnownTypeMembers = new Symbol[(int)WellKnownMember.Count]; 102Symbol? result = null; 245internal static Symbol? GetRuntimeMember(NamedTypeSymbol declaringType, in MemberDescriptor descriptor, SignatureComparer<MethodSymbol, FieldSymbol, PropertySymbol, TypeSymbol, ParameterSymbol> comparer, AssemblySymbol? accessWithinOpt) 251internal static Symbol? GetRuntimeMember(ImmutableArray<Symbol> members, in MemberDescriptor descriptor, SignatureComparer<MethodSymbol, FieldSymbol, PropertySymbol, TypeSymbol, ParameterSymbol> comparer, AssemblySymbol? accessWithinOpt) 257Symbol? result = null; 288foreach (var member in members) 296!(member.DeclaredAccessibility == Accessibility.Public || (accessWithinOpt is object && Symbol.IsSymbolAccessible(member, accessWithinOpt)))) 418var wellKnownMember = Binder.GetWellKnownTypeMember(this, arg.Key, useSiteInfo: out _, isOptional: true); 687var member = Binder.GetWellKnownTypeMember(this, attributeCtor,
Symbols\ConstantValueUtils.cs (1)
80Symbol thisSymbol,
Symbols\ConstraintsHelper.cs (10)
889this Symbol containingSymbol, 927Symbol containingSymbol, 1029Symbol containingSymbol, 1066if (typeArgument.Type is NamedTypeSymbol { IsInterface: true } iface && SelfOrBaseHasStaticAbstractMember(iface, ref useSiteInfo, out Symbol member)) 1093static bool errorIfNotSatisfiesConstructorConstraint(Symbol containingSymbol, TypeParameterSymbol typeParameter, TypeWithAnnotations typeArgument, ArrayBuilder<TypeParameterDiagnosticInfo> diagnosticsBuilder) 1117Symbol containingSymbol, 1140Symbol containingSymbol, 1381private static bool SelfOrBaseHasStaticAbstractMember(NamedTypeSymbol iface, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out Symbol memberWithoutImplementation) 1385foreach (Symbol m in iface.GetMembers()) 1396foreach (Symbol m in baseInterface.GetMembers())
Symbols\ConstructedNamedTypeSymbol.cs (2)
30internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 113internal sealed override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\DiscardSymbol.cs (2)
21public override Symbol? ContainingSymbol => null; 38public override bool Equals(Symbol? obj, TypeCompareKind compareKind) => obj is DiscardSymbol other && this.TypeWithAnnotations.Equals(other.TypeWithAnnotations, compareKind);
Symbols\DynamicTypeSymbol.cs (6)
132public override ImmutableArray<Symbol> GetMembers() 134return ImmutableArray<Symbol>.Empty; 137public override ImmutableArray<Symbol> GetMembers(string name) 139return ImmutableArray<Symbol>.Empty; 167public override Symbol? ContainingSymbol 183internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\ErrorMethodSymbol.cs (2)
104public override Symbol ContainingSymbol 114public override Symbol AssociatedSymbol
Symbols\ErrorPropertySymbol.cs (3)
27private readonly Symbol _containingSymbol; 33public ErrorPropertySymbol(Symbol containingSymbol, TypeSymbol type, string name, bool isIndexer, bool isIndexedProperty) 42public override Symbol ContainingSymbol { get { return _containingSymbol; } }
Symbols\ErrorTypeSymbol.cs (12)
54public virtual ImmutableArray<Symbol> CandidateSymbols 58return ImmutableArray<Symbol>.Empty; 142public override ImmutableArray<Symbol> GetMembers() 146var result = MakeSynthesizedTupleMembers(ImmutableArray<Symbol>.Empty); 151return ImmutableArray<Symbol>.Empty; 159public override ImmutableArray<Symbol> GetMembers(string name) 169internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() 174internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) 241public override Symbol? ContainingSymbol 631public override ImmutableArray<Symbol> CandidateSymbols 690public override Symbol? ContainingSymbol 729public override Symbol ContainingSymbol
Symbols\ErrorTypeSymbol.ErrorTypeParameterSymbol.cs (1)
42public override Symbol ContainingSymbol
Symbols\EventSymbol.cs (2)
42protected sealed override Symbol OriginalSymbolDefinition 330public override bool Equals(Symbol? obj, TypeCompareKind compareKind)
Symbols\ExtendedErrorTypeSymbol.cs (11)
25private readonly ImmutableArray<Symbol> _candidateSymbols; // Best guess at what user meant, but was wrong. 52private ExtendedErrorTypeSymbol(NamespaceOrTypeSymbol? containingSymbol, string name, int arity, DiagnosticInfo? errorInfo, bool unreported, bool variableUsedBeforeDeclaration, ImmutableArray<Symbol> candidateSymbols, LookupResultKind resultKind) 69internal ExtendedErrorTypeSymbol(NamespaceOrTypeSymbol? containingSymbol, Symbol guessSymbol, LookupResultKind resultKind, DiagnosticInfo errorInfo, bool unreported = false) 70: this(containingSymbol, ImmutableArray.Create<Symbol>(guessSymbol), resultKind, errorInfo, GetArity(guessSymbol), unreported) 74internal ExtendedErrorTypeSymbol(NamespaceOrTypeSymbol? containingSymbol, ImmutableArray<Symbol> candidateSymbols, LookupResultKind resultKind, DiagnosticInfo errorInfo, int arity, bool unreported = false) 88private static ImmutableArray<Symbol> UnwrapErrorCandidates(ImmutableArray<Symbol> candidateSymbols) 115public override ImmutableArray<Symbol> CandidateSymbols => _candidateSymbols.NullToEmpty(); 151public override Symbol? ContainingSymbol 270foreach (Symbol sym in oldError._candidateSymbols) 312private static int GetArity(Symbol symbol)
Symbols\FieldSymbol.cs (5)
47protected sealed override Symbol OriginalSymbolDefinition 86public abstract Symbol AssociatedSymbol { get; } 495Symbol found = CSharpCompilation.GetRuntimeMember(ImmutableArray.Create<Symbol>(this), descriptor, CSharpCompilation.SpecialMembersSignatureComparer.Instance, 513public override bool Equals(Symbol other, TypeCompareKind compareKind)
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (4)
703public override bool Equals(Symbol other, TypeCompareKind compareKind) 800internal bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo? result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 817public override Symbol? ContainingSymbol => null; 825public override Symbol? AssociatedSymbol => null;
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (2)
29public override Symbol ContainingSymbol => _containingSymbol; 37public override bool Equals(Symbol other, TypeCompareKind compareKind)
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (6)
79public override Symbol? ContainingSymbol => null; 92public override ImmutableArray<Symbol> GetMembers() => ImmutableArray<Symbol>.Empty; 93public override ImmutableArray<Symbol> GetMembers(string name) => ImmutableArray<Symbol>.Empty; 155internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo? result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\FunctionTypeSymbol.cs (4)
110public override Symbol? ContainingSymbol => null; 136public override ImmutableArray<Symbol> GetMembers() => throw ExceptionUtilities.Unreachable(); 138public override ImmutableArray<Symbol> GetMembers(string name) => throw ExceptionUtilities.Unreachable(); 156internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) => throw ExceptionUtilities.Unreachable();
Symbols\LabelSymbol.cs (1)
153public override Symbol ContainingSymbol
Symbols\MemberSignatureComparer.cs (13)
34internal sealed class MemberSignatureComparer : IEqualityComparer<Symbol> 419public bool Equals(Symbol? member1, Symbol? member2) 532public int GetHashCode(Symbol? member) 564public static bool HaveSameReturnTypes(Symbol member1, TypeMap? typeMap1, Symbol member2, TypeMap? typeMap2, TypeCompareKind typeComparison) 615private static TypeMap? GetTypeMap(Symbol member) 626private static bool HaveSameConstraints(Symbol member1, TypeMap? typeMap1, Symbol member2, TypeMap? typeMap2) 850private static Cci.CallingConvention GetCallingConvention(Symbol member) 864private static bool IsVarargMethod(Symbol member) 882internal static bool ConsideringTupleNamesCreatesDifference(Symbol member1, Symbol member2)
Symbols\MemberSymbolExtensions.cs (37)
24internal static bool HasParamsParameter(this Symbol member) 33internal static ImmutableArray<ParameterSymbol> GetParameters(this Symbol member) 51internal static ImmutableArray<TypeWithAnnotations> GetParameterTypes(this Symbol member) 66internal static bool GetIsVararg(this Symbol member) 83internal static ImmutableArray<RefKind> GetParameterRefKinds(this Symbol member) 98internal static int GetParameterCount(this Symbol member) 114internal static bool HasParameterContainingPointerType(this Symbol member) 127public static bool IsEventOrPropertyWithImplementableNonPublicAccessor(this Symbol symbol) 160public static bool IsAccessor(this Symbol symbol) 167var propertyOrEvent = methodSymbol.AssociatedSymbol; 176public static bool IsOperator(this Symbol symbol) 181public static bool IsIndexer(this Symbol symbol) 186public static bool IsIndexedProperty(this Symbol symbol) 191public static bool IsUserDefinedConversion(this Symbol symbol) 218public static int CustomModifierCount(this Symbol m) 267internal static Symbol SymbolAsMember(this Symbol s, NamedTypeSymbol newOwner) 289internal static int GetMemberArity(this Symbol symbol) 322internal static ImmutableArray<TypeParameterSymbol> GetMemberTypeParameters(this Symbol symbol) 340internal static ImmutableArray<TypeSymbol> GetMemberTypeArgumentsNoUseSiteDiagnostics(this Symbol symbol) 533internal static bool IsExplicitInterfaceImplementation(this Symbol member) 548internal static bool IsPartialMember(this Symbol member) 557internal static bool IsPartialImplementation(this Symbol member) 566internal static bool IsPartialDefinition(this Symbol member) 575internal static bool ContainsTupleNames(this Symbol member) 592internal static ImmutableArray<Symbol> GetExplicitInterfaceImplementations(this Symbol member) 597return ((MethodSymbol)member).ExplicitInterfaceImplementations.Cast<MethodSymbol, Symbol>(); 599return ((PropertySymbol)member).ExplicitInterfaceImplementations.Cast<PropertySymbol, Symbol>(); 601return ((EventSymbol)member).ExplicitInterfaceImplementations.Cast<EventSymbol, Symbol>(); 603return ImmutableArray<Symbol>.Empty; 607internal static Symbol GetOverriddenMember(this Symbol member) 622internal static Symbol GetLeastOverriddenMember(this Symbol member, NamedTypeSymbol accessingTypeOpt) 643internal static bool IsFieldOrFieldLikeEvent(this Symbol member, out FieldSymbol field) 659internal static string GetMemberCallerName(this Symbol member)
Symbols\MergedNamespaceSymbol.cs (12)
46private readonly CachingDictionary<ReadOnlyMemory<char>, Symbol> _cachedLookup; 51private ImmutableArray<Symbol> _allMembers; 96_cachedLookup = new CachingDictionary<ReadOnlyMemory<char>, Symbol>(SlowGetChildrenOfName, SlowGetChildNames, ReadOnlyMemoryOfCharComparer.Instance); 122internal override void ForceComplete(SourceLocation locationOpt, Predicate<Symbol> filter, CancellationToken cancellationToken) 135private ImmutableArray<Symbol> SlowGetChildrenOfName(ReadOnlyMemory<char> name) 138var otherSymbols = ArrayBuilder<Symbol>.GetInstance(); 143foreach (Symbol childSymbol in namespaceSymbol.GetMembers(name)) 183foreach (var child in ns.GetMembersUnordered()) 216public override ImmutableArray<Symbol> GetMembers() 221var builder = ArrayBuilder<Symbol>.GetInstance(); 229public override ImmutableArray<Symbol> GetMembers(ReadOnlyMemory<char> name) 250public override Symbol ContainingSymbol
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (3)
117internal Symbol FindMember(EntityHandle memberRefOrMethodDef, bool methodsOnly) 176foreach (Symbol member in targetTypeSymbol.GetMembers(targetMemberName)) 199foreach (Symbol member in targetTypeSymbol.GetMembers(targetMemberName))
Symbols\Metadata\PE\MetadataDecoder.cs (5)
21internal class MetadataDecoder : MetadataDecoder<PEModuleSymbol, TypeSymbol, MethodSymbol, FieldSymbol, Symbol> 494foreach (Symbol member in typeSymbol.GetMembersUnordered()) 519foreach (Symbol member in typeSymbol.GetMembersUnordered()) 531internal override Symbol GetSymbolForMemberRef(MemberReferenceHandle memberRef, TypeSymbol scope = null, bool methodsOnly = false) 566var definition = memberRefDecoder.FindMember(memberRef, methodsOnly);
Symbols\Metadata\PE\NullableTypeDecoder.cs (2)
24Symbol accessSymbol, 25Symbol nullableContext)
Symbols\Metadata\PE\PEEventSymbol.cs (1)
217public override Symbol ContainingSymbol
Symbols\Metadata\PE\PEFieldSymbol.cs (2)
162public override Symbol ContainingSymbol 449public override Symbol AssociatedSymbol
Symbols\Metadata\PE\PEGlobalNamespaceSymbol.cs (1)
34public override Symbol ContainingSymbol
Symbols\Metadata\PE\PEMethodSymbol.cs (4)
383private Symbol _associatedPropertyOrEventOpt; 444public override Symbol ContainingSymbol => _containingType; 800private bool SetAssociatedPropertyOrEvent(Symbol propertyOrEventSymbol, MethodKind methodKind) 963public override Symbol AssociatedSymbol => _associatedPropertyOrEventOpt;
Symbols\Metadata\PE\PEModuleSymbol.cs (2)
218public override Symbol ContainingSymbol 791internal bool ShouldDecodeNullableAttributes(Symbol symbol)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (37)
52private ImmutableArray<Symbol> _lazyMembersInDeclarationOrder; 58private Dictionary<string, ImmutableArray<Symbol>> _lazyMembersByName; 371Symbol s = _container; 606public override Symbol ContainingSymbol 898public override ImmutableArray<Symbol> GetMembers() 952ImmutableArray<Symbol> staticFields = GetMembers(); 1062ImmutableArray<Symbol> members = GetMembers(); 1165internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() 1170internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) 1175private class DeclarationOrderTypeSymbolComparer : IComparer<Symbol> 1181public int Compare(Symbol x, Symbol y) 1271ArrayBuilder<Symbol> members = null; 1277members = ArrayBuilder<Symbol>.GetInstance(); 1326ArrayBuilder<Symbol> nonFieldMembers = ArrayBuilder<Symbol>.GetInstance(); 1402Symbol previous = null; 1412Symbol current = s; 1447members = ArrayBuilder<Symbol>.GetInstance(); 1448foreach (var member in _lazyMembersInDeclarationOrder) 1458Dictionary<string, ImmutableArray<Symbol>> membersDict = GroupByName(members); 1491internal override ImmutableArray<Symbol> GetSimpleNonTypeMembers(string name) 1495ImmutableArray<Symbol> m; 1498m = ImmutableArray<Symbol>.Empty; 1504public override ImmutableArray<Symbol> GetMembers(string name) 1508ImmutableArray<Symbol> m; 1511m = ImmutableArray<Symbol>.Empty; 1518m = m.Concat(StaticCast<Symbol>.From(t)); 1981private PooledDictionary<MethodDefinitionHandle, PEMethodSymbol> CreateMethods(ArrayBuilder<Symbol> members) 2008private void CreateProperties(Dictionary<MethodDefinitionHandle, PEMethodSymbol> methodHandleToSymbol, ArrayBuilder<Symbol> members) 2040ArrayBuilder<Symbol> members) 2085private static Dictionary<string, ImmutableArray<Symbol>> GroupByName(ArrayBuilder<Symbol> symbols) 2439private static int GetIndexOfFirstMember(ImmutableArray<Symbol> members, SymbolKind kind) 2456private static IEnumerable<TSymbol> GetMembers<TSymbol>(ImmutableArray<Symbol> members, SymbolKind kind, int offset = -1) 2457where TSymbol : Symbol 2466var member = members[i];
Symbols\Metadata\PE\PENamespaceSymbol.cs (11)
53private ImmutableArray<Symbol> _lazyFlattenedNamespacesAndTypes; 65Constraint = "Provide " + nameof(ArrayBuilder<Symbol>) + " capacity to reduce number of allocations.", 67public sealed override ImmutableArray<Symbol> GetMembers() 77ImmutableArray<Symbol> calculateMembers() 82return StaticCast<Symbol>.From(memberTypes); 84var builder = ArrayBuilder<Symbol>.GetInstance(memberTypes.Length + lazyNamespaces.Count); 120public sealed override ImmutableArray<Symbol> GetMembers(ReadOnlyMemory<char> name) 132return StaticCast<Symbol>.From(t).Add(ns); 136return ImmutableArray.Create<Symbol>(ns); 141return StaticCast<Symbol>.From(t); 144return ImmutableArray<Symbol>.Empty;
Symbols\Metadata\PE\PENestedNamespaceSymbol.cs (1)
84public override Symbol ContainingSymbol
Symbols\Metadata\PE\PEParameterSymbol.cs (12)
152private readonly Symbol _containingSymbol; 197Symbol nullableContext, 225Symbol nullableContext, 236Symbol containingSymbol, 241Symbol nullableContext, 316var accessSymbol = containingSymbol.Kind == SymbolKind.Property ? containingSymbol.ContainingSymbol : containingSymbol; 377Symbol containingSymbol, 384Symbol nullableContext, 424Symbol containingSymbol, 430Symbol nullableContext, 513public override Symbol ContainingSymbol 1179public sealed override bool Equals(Symbol other, TypeCompareKind compareKind)
Symbols\Metadata\PE\PEPropertySymbol.cs (2)
398public override Symbol ContainingSymbol 905Symbol nullableContext;
Symbols\Metadata\PE\PETypeParameterSymbol.cs (5)
27private readonly Symbol _containingSymbol; // Could be PENamedType or a PEMethod 51: this(moduleSymbol, (Symbol)definingNamedType, ordinal, handle) 60: this(moduleSymbol, (Symbol)definingMethod, ordinal, handle) 66Symbol definingSymbol, 137public override Symbol ContainingSymbol
Symbols\Metadata\PE\PEUtilities.cs (1)
11internal static DiagnosticInfo? DeriveCompilerFeatureRequiredAttributeDiagnostic(Symbol symbol, PEModuleSymbol module, EntityHandle handle, CompilerFeatureRequiredFeatures allowedFeatures, MetadataDecoder decoder)
Symbols\MetadataOrSourceAssemblySymbol.cs (4)
175private Symbol[] _lazySpecialTypeMembers; 181internal override Symbol GetDeclaredSpecialTypeMember(SpecialMember member) 194var specialTypeMembers = new Symbol[(int)SpecialMember.Count]; 206Symbol result = null;
Symbols\MethodSymbol.cs (3)
53protected sealed override Symbol OriginalSymbolDefinition 407public abstract Symbol AssociatedSymbol { get; } 1248public override bool Equals(Symbol other, TypeCompareKind compareKind)
Symbols\MissingAssemblySymbol.cs (2)
54internal override Symbol GetDeclaredSpecialTypeMember(SpecialMember member) 96public override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\MissingMetadataTypeSymbol.cs (2)
236public override Symbol ContainingSymbol 429public override Symbol ContainingSymbol
Symbols\MissingModuleSymbol.cs (3)
89public override Symbol ContainingSymbol 110public override bool Equals(Symbol obj, TypeCompareKind compareKind) 232public override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\MissingNamespaceSymbol.cs (7)
21private readonly Symbol _containingSymbol; 48public override Symbol ContainingSymbol 82public override bool Equals(Symbol obj, TypeCompareKind compareKind) 125public override ImmutableArray<Symbol> GetMembers() 127return ImmutableArray<Symbol>.Empty; 130public override ImmutableArray<Symbol> GetMembers(ReadOnlyMemory<char> name) 132return ImmutableArray<Symbol>.Empty;
Symbols\NamedTypeSymbol.cs (29)
29private static readonly ImmutableSegmentedDictionary<string, Symbol> RequiredMembersErrorSentinel = ImmutableSegmentedDictionary<string, Symbol>.Empty.Add("<error sentinel>", null!); 35private ImmutableSegmentedDictionary<string, Symbol> _lazyRequiredMembers = default; 211ImmutableArray<Symbol> candidates = GetSimpleNonTypeMembers(name); 218foreach (var candidate in candidates) 266ImmutableArray<Symbol> instanceCandidates = includeInstance 268: ImmutableArray<Symbol>.Empty; 269ImmutableArray<Symbol> staticCandidates = includeStatic 271: ImmutableArray<Symbol>.Empty; 279foreach (Symbol candidate in instanceCandidates) 287foreach (Symbol candidate in staticCandidates) 308ImmutableArray<Symbol> candidates = GetSimpleNonTypeMembers(WellKnownMemberNames.Indexer); 318foreach (Symbol candidate in candidates) 353foreach (var member in members) 558internal ImmutableSegmentedDictionary<string, Symbol> AllRequiredMembers 566return ImmutableSegmentedDictionary<string, Symbol>.Empty; 580bool success = tryCalculateRequiredMembers(out ImmutableSegmentedDictionary<string, Symbol>.Builder? builder); 583? builder?.ToImmutable() ?? BaseTypeNoUseSiteDiagnostics?.AllRequiredMembers ?? ImmutableSegmentedDictionary<string, Symbol>.Empty 588bool tryCalculateRequiredMembers(out ImmutableSegmentedDictionary<string, Symbol>.Builder? requiredMembersBuilder) 596var baseAllRequiredMembers = BaseTypeNoUseSiteDiagnostics?.AllRequiredMembers ?? ImmutableSegmentedDictionary<string, Symbol>.Empty; 599foreach (var member in GetMembersUnordered()) 651public abstract override ImmutableArray<Symbol> GetMembers(); 658public abstract override ImmutableArray<Symbol> GetMembers(string name); 667internal virtual ImmutableArray<Symbol> GetSimpleNonTypeMembers(string name) 694internal virtual IEnumerable<Symbol> GetInstanceFieldsAndEvents() 699protected static Func<Symbol, bool> IsInstanceFieldOrEvent = symbol => 745internal abstract ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(); 755internal abstract ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name); 1441internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\NamespaceOrTypeSymbol.cs (3)
110public abstract ImmutableArray<Symbol> GetMembers(); 118internal virtual ImmutableArray<Symbol> GetMembersUnordered() 131public abstract ImmutableArray<Symbol> GetMembers(string name);
Symbols\NamespaceSymbol.cs (3)
267foreach (var sym in this.GetMembers(name)) 278public abstract ImmutableArray<Symbol> GetMembers(ReadOnlyMemory<char> name); 280public sealed override ImmutableArray<Symbol> GetMembers(string name)
Symbols\NativeIntegerTypeSymbol.cs (22)
26private ImmutableArray<Symbol> _lazyMembers; 42public override Symbol ContainingSymbol => _underlyingType.ContainingSymbol; 69public override ImmutableArray<Symbol> GetMembers() 77ImmutableArray<Symbol> makeMembers(ImmutableArray<Symbol> underlyingMembers) 79var builder = ArrayBuilder<Symbol>.GetInstance(); 80foreach (var underlyingMember in underlyingMembers) 140public override ImmutableArray<Symbol> GetMembers(string name) => GetMembers().WhereAsArray((member, name) => member.Name == name, name); 152internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() => throw ExceptionUtilities.Unreachable(); 154internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) => throw ExceptionUtilities.Unreachable(); 245internal static bool EqualsHelper<TSymbol>(TSymbol symbol, Symbol? other, TypeCompareKind comparison, Func<TSymbol, Symbol> getUnderlyingSymbol) 246where TSymbol : Symbol 265internal static void VerifyEquality(Symbol symbolA, Symbol symbolB) 343public override Symbol ContainingSymbol => _container; 372public override Symbol? AssociatedSymbol => _associatedSymbol; 381public override bool Equals(Symbol? other, TypeCompareKind comparison) => NativeIntegerTypeSymbol.EqualsHelper(this, other, comparison, symbol => symbol.UnderlyingMethod); 417public override Symbol ContainingSymbol => _container; 435public override bool Equals(Symbol? other, TypeCompareKind comparison) => NativeIntegerTypeSymbol.EqualsHelper(this, other, comparison, symbol => symbol._underlyingParameter); 468public override Symbol ContainingSymbol => _container; 484public override bool Equals(Symbol? other, TypeCompareKind comparison) => NativeIntegerTypeSymbol.EqualsHelper(this, other, comparison, symbol => symbol._underlyingProperty);
Symbols\NonMissingModuleSymbol.cs (1)
100var involvedAssemblies = ImmutableArray.Create<Symbol>(ownerAssembly, dependentAssembly);
Symbols\ObsoleteAttributeHelpers.cs (9)
59private static ThreeState GetObsoleteContextState(Symbol symbol, bool forceComplete, Func<Symbol, ThreeState> getStateFromSymbol) 66var associatedSymbol = ((FieldSymbol)symbol).AssociatedSymbol; 98internal static ObsoleteDiagnosticKind GetObsoleteDiagnosticKind(Symbol symbol, Symbol containingMember, bool forceComplete = false) 130static ObsoleteDiagnosticKind getDiagnosticKind(Symbol containingMember, bool forceComplete, Func<Symbol, ThreeState> getStateFromSymbol) 152internal static DiagnosticInfo CreateObsoleteDiagnostic(Symbol symbol, BinderFlags location) 158static DiagnosticInfo createObsoleteDiagnostic(Symbol symbol, BinderFlags location)
Symbols\OverriddenOrHiddenMembersHelpers.cs (68)
84private static OverriddenOrHiddenMembersResult MakeOverriddenOrHiddenMembersWorker(Symbol member) 97Symbol associatedPropertyOrEvent = accessor.AssociatedSymbol; 134ArrayBuilder<Symbol> hiddenBuilder; 135ImmutableArray<Symbol> overriddenMembers; 138ImmutableArray<Symbol> hiddenMembers = hiddenBuilder == null ? ImmutableArray<Symbol>.Empty : hiddenBuilder.ToImmutableAndFree(); 142private static void FindOverriddenOrHiddenMembers(Symbol member, NamedTypeSymbol containingType, bool memberIsFromSomeCompilation, 143out ArrayBuilder<Symbol> hiddenBuilder, 144out ImmutableArray<Symbol> overriddenMembers) 146Symbol bestMatch = null; 151Symbol knownOverriddenMember = member switch 180public static Symbol FindFirstHiddenMemberIfAny(Symbol member, bool memberIsFromSomeCompilation) 182ArrayBuilder<Symbol> hiddenBuilder; 186Symbol result = hiddenBuilder?.FirstOrDefault(); 249ArrayBuilder<Symbol> hiddenBuilder = null; 253foreach (Symbol hiddenByProperty in hiddenOrOverriddenByProperty.HiddenMembers) 283ImmutableArray<Symbol> overriddenAccessors = ImmutableArray<Symbol>.Empty; 291ImmutableArray<Symbol> hiddenMembers = hiddenBuilder == null ? ImmutableArray<Symbol>.Empty : hiddenBuilder.ToImmutableAndFree(); 341ArrayBuilder<Symbol> hiddenBuilder = null; 345foreach (Symbol hiddenByEvent in hiddenOrOverriddenByEvent.HiddenMembers) 373ImmutableArray<Symbol> overriddenAccessors = ImmutableArray<Symbol>.Empty; 383ImmutableArray<Symbol> hiddenMembers = hiddenBuilder == null ? ImmutableArray<Symbol>.Empty : hiddenBuilder.ToImmutableAndFree(); 409internal static OverriddenOrHiddenMembersResult MakeInterfaceOverriddenOrHiddenMembers(Symbol member, bool memberIsFromSomeCompilation) 419ArrayBuilder<Symbol> hiddenBuilder = null; 428Symbol currTypeBestMatch; 430ArrayBuilder<Symbol> currTypeHiddenBuilder; 492ImmutableArray<Symbol> overriddenMembers = ImmutableArray<Symbol>.Empty; 496ArrayBuilder<Symbol> hiddenAndRelatedBuilder = null; 497foreach (Symbol hidden in hiddenBuilder) 508ImmutableArray<Symbol> hiddenMembers = hiddenBuilder == null ? ImmutableArray<Symbol>.Empty : hiddenBuilder.ToImmutableAndFree(); 533Symbol member, 536Symbol knownOverriddenMember, 538out Symbol currTypeBestMatch, 540out ArrayBuilder<Symbol> hiddenBuilder) 551IEqualityComparer<Symbol> exactMatchComparer = memberIsFromSomeCompilation 555IEqualityComparer<Symbol> fallbackComparer = memberIsFromSomeCompilation 562foreach (Symbol otherMember in currType.GetMembers(member.Name)) 674Symbol minCustomModifierMatch = currTypeBestMatch; 676foreach (Symbol otherMember in currType.GetMembers(member.Name)) 708Symbol representativeMember, 709out ImmutableArray<Symbol> overriddenMembers, 710ref ArrayBuilder<Symbol> hiddenBuilder) 712overriddenMembers = ImmutableArray<Symbol>.Empty; 723ArrayBuilder<Symbol> overriddenBuilder = ArrayBuilder<Symbol>.GetInstance(); 733overriddenMembers = ImmutableArray.Create<Symbol>(representativeMember); 753private static void AddHiddenMemberIfApplicable(ref ArrayBuilder<Symbol> hiddenBuilder, SymbolKind hidingMemberKind, Symbol hiddenMember) 789private static void FindOtherOverriddenMethodsInContainingType(Symbol representativeMember, bool overridingMemberIsFromSomeCompilation, ArrayBuilder<Symbol> overriddenBuilder) 796foreach (Symbol otherMember in representativeMember.ContainingType.GetMembers(representativeMember.Name)) 851private static void FindOtherHiddenMembersInContainingType(SymbolKind hidingMemberKind, Symbol representativeMember, ref ArrayBuilder<Symbol> hiddenBuilder) 858IEqualityComparer<Symbol> comparer = MemberSignatureComparer.CSharpCustomModifierOverrideComparer; 859foreach (Symbol otherMember in representativeMember.ContainingType.GetMembers(representativeMember.Name)) 871private static bool CanOverrideOrHide(Symbol member) 887private static bool TypeOrReturnTypeHasCustomModifiers(Symbol member) 909private static int CustomModifierCount(Symbol member) 991foreach (Symbol otherMethod in method.ContainingType.GetMembers(method.Name)) 1032foreach (Symbol otherMember in currType.GetMembers(method.Name)) 1070private static bool IsOverriddenSymbolAccessible(Symbol overridden, NamedTypeSymbol overridingContainingType)
Symbols\OverriddenOrHiddenMembersResult.cs (17)
23ImmutableArray<Symbol>.Empty, 24ImmutableArray<Symbol>.Empty); 26private readonly ImmutableArray<Symbol> _overriddenMembers; 27public ImmutableArray<Symbol> OverriddenMembers { get { return _overriddenMembers; } } 29private readonly ImmutableArray<Symbol> _hiddenMembers; 30public ImmutableArray<Symbol> HiddenMembers { get { return _hiddenMembers; } } 33ImmutableArray<Symbol> overriddenMembers, 34ImmutableArray<Symbol> hiddenMembers) 41ImmutableArray<Symbol> overriddenMembers, 42ImmutableArray<Symbol> hiddenMembers) 54internal static Symbol GetOverriddenMember(Symbol substitutedOverridingMember, Symbol overriddenByDefinitionMember) 85/// associated with a member within substituted type, <see cref="GetOverriddenMember(Symbol, Symbol)"/> 88internal Symbol GetOverriddenMember() 90foreach (var overriddenMember in _overriddenMembers)
Symbols\ParameterSymbol.cs (1)
38protected sealed override Symbol OriginalSymbolDefinition
Symbols\PointerTypeSymbol.cs (6)
132public override ImmutableArray<Symbol> GetMembers() 134return ImmutableArray<Symbol>.Empty; 137public override ImmutableArray<Symbol> GetMembers(string name) 139return ImmutableArray<Symbol>.Empty; 173public override Symbol? ContainingSymbol 294internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\PropertyOrEventSymbolExtensions.cs (1)
32private static ISet<T> GetSymbolsForExplicitlyImplementedAccessor<T>(MethodSymbol accessor) where T : Symbol
Symbols\PropertySymbol.cs (2)
49protected sealed override Symbol OriginalSymbolDefinition 453public override bool Equals(Symbol symbol, TypeCompareKind compareKind)
Symbols\PublicModel\AliasSymbol.cs (1)
19internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\ArrayTypeSymbol.cs (1)
31internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\DiscardSymbol.cs (1)
21internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\DynamicTypeSymbol.cs (1)
28internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\ErrorTypeSymbol.cs (1)
29internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\EventSymbol.cs (1)
22internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\FieldSymbol.cs (1)
24internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\FunctionPointerTypeSymbol.cs (1)
24internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\LabelSymbol.cs (1)
19internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\LocalSymbol.cs (1)
23internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\MethodSymbol.cs (1)
30internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\ModuleSymbol.cs (1)
22internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\NamespaceSymbol.cs (3)
23internal override CSharp.Symbol UnderlyingSymbol => _underlying; 43foreach (var n in _underlying.GetMembers()) 51foreach (var n in _underlying.GetMembers(name))
Symbols\PublicModel\NonErrorNamedTypeSymbol.cs (1)
30internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\NonSourceAssemblySymbol.cs (1)
23internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\ParameterSymbol.cs (1)
24internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\PointerTypeSymbol.cs (1)
30internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\PropertySymbol.cs (1)
24internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\RangeVariableSymbol.cs (1)
21internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\SourceAssemblySymbol.cs (1)
22internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\PublicModel\Symbol.cs (1)
17internal abstract CSharp.Symbol UnderlyingSymbol { get; }
Symbols\PublicModel\TypeParameterSymbol.cs (1)
31internal override CSharp.Symbol UnderlyingSymbol => _underlying;
Symbols\RangeVariableSymbol.cs (4)
20private readonly Symbol _containingSymbol; 22internal RangeVariableSymbol(string Name, Symbol containingSymbol, Location? location, bool isTransparent = false) 135public override Symbol ContainingSymbol 158public override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\ReducedExtensionMethodSymbol.cs (5)
452public override Symbol ContainingSymbol 462public override Symbol AssociatedSymbol 585public override bool Equals(Symbol obj, TypeCompareKind compareKind) 628public override Symbol ContainingSymbol 679public sealed override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
132public override Symbol? ContainingSymbol
Symbols\Retargeting\RetargetingFieldSymbol.cs (3)
65public override Symbol ContainingSymbol 112public override Symbol AssociatedSymbol 116var associated = _underlyingField.AssociatedSymbol;
Symbols\Retargeting\RetargetingMethodSymbol.cs (3)
186public override Symbol AssociatedSymbol 190var associatedPropertyOrEvent = _underlyingMethod.AssociatedSymbol; 195public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingModuleSymbol.cs (1)
160public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (6)
120public override ImmutableArray<Symbol> GetMembers() 125internal override ImmutableArray<Symbol> GetMembersUnordered() 130public override ImmutableArray<Symbol> GetMembers(string name) 184internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() 189internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) 214public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingNamespaceSymbol.cs (8)
73public override ImmutableArray<Symbol> GetMembers() 78private ImmutableArray<Symbol> RetargetMembers(ImmutableArray<Symbol> underlyingMembers) 80var builder = ArrayBuilder<Symbol>.GetInstance(underlyingMembers.Length); 82foreach (Symbol s in underlyingMembers) 96internal override ImmutableArray<Symbol> GetMembersUnordered() 101public override ImmutableArray<Symbol> GetMembers(ReadOnlyMemory<char> name) 145public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingParameterSymbol.cs (2)
63public sealed override Symbol ContainingSymbol 135/// short circuits the overhead in <see cref="Symbol.DeclaringCompilation"/> and the extra virtual
Symbols\Retargeting\RetargetingPropertySymbol.cs (1)
192public override Symbol ContainingSymbol
Symbols\Retargeting\RetargetingSymbolTranslator.cs (42)
31private readonly ConcurrentDictionary<Symbol, Symbol> _symbolMap = 32new ConcurrentDictionary<Symbol, Symbol>(concurrencyLevel: 2, capacity: 4); 34private readonly Func<Symbol, RetargetingMethodSymbol> _createRetargetingMethod; 35private readonly Func<Symbol, RetargetingNamespaceSymbol> _createRetargetingNamespace; 36private readonly Func<Symbol, RetargetingTypeParameterSymbol> _createRetargetingTypeParameter; 37private readonly Func<Symbol, RetargetingNamedTypeSymbol> _createRetargetingNamedType; 38private readonly Func<Symbol, FieldSymbol> _createRetargetingField; 39private readonly Func<Symbol, RetargetingPropertySymbol> _createRetargetingProperty; 40private readonly Func<Symbol, RetargetingEventSymbol> _createRetargetingEvent; 42private RetargetingMethodSymbol CreateRetargetingMethod(Symbol symbol) 48private RetargetingNamespaceSymbol CreateRetargetingNamespace(Symbol symbol) 54private RetargetingNamedTypeSymbol CreateRetargetingNamedType(Symbol symbol) 60private FieldSymbol CreateRetargetingField(Symbol symbol) 86private RetargetingPropertySymbol CreateRetargetingProperty(Symbol symbol) 92private RetargetingEventSymbol CreateRetargetingEvent(Symbol symbol) 98private RetargetingTypeParameterSymbol CreateRetargetingTypeParameter(Symbol symbol) 105: CSharpSymbolVisitor<RetargetOptions, Symbol> 118private ConcurrentDictionary<Symbol, Symbol> SymbolMap 162public Symbol Retarget(Symbol symbol) 827public ImmutableArray<Symbol> Retarget(ImmutableArray<Symbol> arr) 1029foreach (var retargetedMember in retargetedType.GetMembers(method.Name)) 1095foreach (var retargetedMember in retargetedType.GetMembers(property.Name)) 1114foreach (var retargetedMember in retargetedType.GetMembers(@event.Name)) 1317public override Symbol VisitModule(ModuleSymbol symbol, RetargetOptions options) 1324public override Symbol VisitNamespace(NamespaceSymbol symbol, RetargetOptions options) 1329public override Symbol VisitNamedType(NamedTypeSymbol symbol, RetargetOptions options) 1334public override Symbol VisitArrayType(ArrayTypeSymbol symbol, RetargetOptions options) 1339public override Symbol VisitPointerType(PointerTypeSymbol symbol, RetargetOptions options) 1344public override Symbol VisitFunctionPointerType(FunctionPointerTypeSymbol symbol, RetargetOptions argument) 1349public override Symbol VisitMethod(MethodSymbol symbol, RetargetOptions options) 1354public override Symbol VisitParameter(ParameterSymbol symbol, RetargetOptions options) 1359public override Symbol VisitField(FieldSymbol symbol, RetargetOptions options) 1364public override Symbol VisitProperty(PropertySymbol symbol, RetargetOptions argument) 1369public override Symbol VisitTypeParameter(TypeParameterSymbol symbol, RetargetOptions options) 1374public override Symbol VisitErrorType(ErrorTypeSymbol symbol, RetargetOptions options) 1379public override Symbol VisitEvent(EventSymbol symbol, RetargetOptions options) 1384public override Symbol VisitDynamicType(DynamicTypeSymbol symbol, RetargetOptions argument)
Symbols\Retargeting\RetargetingTypeParameterSymbol.cs (1)
55public override Symbol ContainingSymbol
Symbols\SignatureOnlyMethodSymbol.cs (2)
91public override Symbol ContainingSymbol { get { return _containingType; } } 131public override Symbol AssociatedSymbol { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\SignatureOnlyParameterSymbol.cs (2)
93public override Symbol ContainingSymbol { get { throw ExceptionUtilities.Unreachable(); } } 109public override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\SignatureOnlyPropertySymbol.cs (1)
62public override Symbol ContainingSymbol { get { return _containingType; } }
Symbols\Source\CrefTypeParameterSymbol.cs (1)
169public override Symbol ContainingSymbol
Symbols\Source\ExplicitInterfaceHelpers.cs (12)
113public static ImmutableArray<T> SubstituteExplicitInterfaceImplementations<T>(ImmutableArray<T> unsubstitutedExplicitInterfaceImplementations, TypeMap map) where T : Symbol 124public static T SubstituteExplicitInterfaceImplementation<T>(T unsubstitutedPropertyImplemented, TypeMap map) where T : Symbol 132foreach (var candidateMember in explicitInterfaceType.GetMembers(name)) 175private static Symbol FindExplicitlyImplementedMember( 176Symbol implementingMember, 241Symbol implementedMember = null; 253foreach (Symbol interfaceMember in explicitInterfaceNamedType.GetMembers(interfaceMemberName)) 346this Symbol implementingMember, 347Symbol implementedMember, 378private static void FindExplicitImplementationCollisions(Symbol implementingMember, Symbol implementedMember, BindingDiagnosticBag diagnostics) 388foreach (Symbol collisionCandidateMember in explicitInterfaceType.GetMembers(implementedMember.Name))
Symbols\Source\IndexedTypeParameterSymbol.cs (1)
184public override Symbol ContainingSymbol
Symbols\Source\LambdaSymbol.cs (5)
18private readonly Symbol _containingSymbol; 44Symbol containingSymbol, 182public override Symbol? AssociatedSymbol 254public override Symbol ContainingSymbol 392public sealed override bool Equals(Symbol symbol, TypeCompareKind compareKind)
Symbols\Source\LocalFunctionSymbol.cs (5)
19private readonly Symbol _containingSymbol; 39Symbol containingSymbol, 328public sealed override Symbol ContainingSymbol => _containingSymbol; 353public override Symbol? AssociatedSymbol => null; 524public sealed override bool Equals(Symbol symbol, TypeCompareKind compareKind)
Symbols\Source\ModifierUtils.cs (1)
460internal static bool CheckAccessibility(DeclarationModifiers modifiers, Symbol symbol, bool isExplicitInterfaceImplementation, BindingDiagnosticBag diagnostics, Location errorLocation)
Symbols\Source\ParameterHelpers.cs (12)
22Symbol owner, 30return MakeParameters<ParameterSyntax, SourceParameterSymbol, Symbol>( 41parameterCreationFunc: (Binder context, Symbol owner, TypeWithAnnotations parameterType, 128where TOwningSymbol : Symbol 379internal static void EnsureNullableAttributeExists(PEModuleBuilder moduleBuilder, Symbol container, ImmutableArray<ParameterSymbol> parameters) 384internal static void EnsureNullableAttributeExists(CSharpCompilation? compilation, Symbol container, ImmutableArray<ParameterSymbol> parameters, BindingDiagnosticBag? diagnostics, bool modifyCompilation) 396private static void EnsureNullableAttributeExists(CSharpCompilation compilation, Symbol container, ImmutableArray<ParameterSymbol> parameters, BindingDiagnosticBag? diagnostics, bool modifyCompilation, PEModuleBuilder? moduleBuilder) 647Symbol? owner, 654Symbol? containingSymbol, 709Symbol owner, 905internal static MethodSymbol FindContainingGenericMethod(Symbol symbol) 907for (Symbol current = symbol; (object)current != null; current = current.ContainingSymbol)
Symbols\Source\SourceAssemblySymbol.cs (5)
210internal override Symbol GetSpecialTypeMember(SpecialMember member) 905internal override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken) 1111foreach (Symbol member in mergedNs.GetMembers()) 2071foreach (var member in ns.GetMembersUnordered()) 2731Symbol associatedPropertyOrEvent = field.AssociatedSymbol;
Symbols\Source\SourceClonedParameterSymbol.cs (1)
25internal SourceClonedParameterSymbol(SourceParameterSymbol originalParam, Symbol newOwner, int newOrdinal, bool suppressOptional)
Symbols\Source\SourceComplexParameterSymbol.cs (4)
41Symbol owner, 1517internal override void ForceComplete(SourceLocation locationOpt, Predicate<Symbol> filter, CancellationToken cancellationToken) 1692Symbol owner, 1718Symbol owner,
Symbols\Source\SourceDelegateMethodSymbol.cs (1)
47ArrayBuilder<Symbol> symbols,
Symbols\Source\SourceEnumConstantSymbol.cs (2)
65public override Symbol AssociatedSymbol 100internal sealed override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken)
Symbols\Source\SourceEventAccessorSymbol.cs (1)
94public sealed override Symbol AssociatedSymbol
Symbols\Source\SourceEventFieldSymbol.cs (1)
51public override Symbol AssociatedSymbol
Symbols\Source\SourceEventSymbol.cs (3)
73internal override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken) 93public sealed override Symbol ContainingSymbol 703foreach (Symbol interfaceMember in @interface.GetMembers(this.Name))
Symbols\Source\SourceFieldLikeEventSymbol.cs (1)
185internal override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken)
Symbols\Source\SourceFieldSymbol.cs (1)
98public sealed override Symbol ContainingSymbol
Symbols\Source\SourceFixedFieldSymbol.cs (7)
163public override Symbol ContainingSymbol 218public override ImmutableArray<Symbol> GetMembers() 220return ImmutableArray.Create<Symbol>(_constructor, _internalField); 223public override ImmutableArray<Symbol> GetMembers(string name) 226(name == _constructor.Name) ? ImmutableArray.Create<Symbol>(_constructor) : 227(name == FixedElementFieldName) ? ImmutableArray.Create<Symbol>(_internalField) : 228ImmutableArray<Symbol>.Empty;
Symbols\Source\SourceLabelSymbol.cs (2)
115public override Symbol ContainingSymbol 146public override bool Equals(Symbol? obj, TypeCompareKind compareKind)
Symbols\Source\SourceLocalSymbol.cs (11)
31private readonly Symbol _containingSymbol; 42Symbol containingSymbol, 136Symbol containingSymbol, 156Symbol containingSymbol, 201Symbol containingSymbol, 259public override Symbol ContainingSymbol 485public sealed override bool Equals(Symbol obj, TypeCompareKind compareKind) 525Symbol containingSymbol, 626Symbol containingSymbol, 666Symbol containingSymbol, 730Symbol containingSymbol,
Symbols\Source\SourceMemberContainerSymbol.cs (144)
183private static readonly ObjectPool<PooledDictionary<Symbol, Symbol>> s_duplicateRecordMemberSignatureDictionary = 184PooledDictionary<Symbol, Symbol>.CreatePool(MemberSignatureComparer.RecordAPISignatureComparer); 206private Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>>? _lazyMembersDictionary; 207private Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>>? _lazyEarlyAttributeDecodingMembersDictionary; 213private ImmutableArray<Symbol> _lazyMembersFlattened; 291Symbol containingSymbol = this.ContainingSymbol; 538internal override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken) 632ImmutableArray<Symbol> members = this.GetMembersUnordered(); 638foreach (var member in members) 646foreach (var member in members) 719foreach (var member in membersAndInitializers.NonTypeMembers) 763public sealed override Symbol ContainingSymbol 895for (Symbol? container = this.ContainingType; !(container is null); container = container.ContainingType) 1048internal readonly ImmutableArray<Symbol> NonTypeMembers; 1057ImmutableArray<Symbol> nonTypeMembers, 1377private void CheckMemberNameDistinctFromType(Symbol member, BindingDiagnosticBag diagnostics) 1421internal static bool HasAsyncMethodBuilderAttribute(Symbol symbol, [NotNullWhen(true)] out TypeSymbol? builderArgument) 1443internal override ImmutableArray<Symbol> GetMembersUnordered() 1457public override ImmutableArray<Symbol> GetMembers() 1479public sealed override ImmutableArray<Symbol> GetMembers(string name) 1481ImmutableArray<Symbol> members; 1487return ImmutableArray<Symbol>.Empty; 1498internal override ImmutableArray<Symbol> GetSimpleNonTypeMembers(string name) 1505return ImmutableArray<Symbol>.Empty; 1518foreach (var m in this.GetMembers()) 1548internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() 1560internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) 1562ImmutableArray<Symbol> result; 1563return GetEarlyAttributeDecodingMembersDictionary().TryGetValue(name.AsMemory(), out result) ? result : ImmutableArray<Symbol>.Empty; 1566private Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> GetEarlyAttributeDecodingMembersDictionary() 1570if (Volatile.Read(ref _lazyMembersDictionary) is Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> result) 1580Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName; 1603private static Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> ToNameKeyedDictionary(ImmutableArray<Symbol> symbols) 1607return new Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>>(1, ReadOnlyMemoryOfCharComparer.Instance) 1615return new Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>>(ReadOnlyMemoryOfCharComparer.Instance); 1625foreach (var item in symbols) 1628var dictionary = new Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>>(accumulator.Count, ReadOnlyMemoryOfCharComparer.Instance); 1633dictionary.Add(pair.Key, pair.Value is ArrayBuilder<Symbol> arrayBuilder 1635: ImmutableArray.Create((Symbol)pair.Value)); 1679internal void AssertMemberExposure(Symbol member, bool forDiagnostics = false) 1739static bool isMemberInCompleteMemberList(MembersAndInitializers? membersAndInitializers, Symbol member) 1745protected Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> GetMembersByName() 1755private Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> GetMembersByNameSlow() 1777internal override IEnumerable<Symbol> GetInstanceFieldsAndEvents() 1781IEnumerable<Symbol> result = membersAndInitializers.NonTypeMembers.Where(IsInstanceFieldOrEvent); 1920foreach (var member in GetMembersAndInitializers().NonTypeMembers) 1934foreach (var member in GetMembers("Clone")) 1942Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName = GetMembersByName(); 1989Symbol? lastSym = GetTypeMembers(name).FirstOrDefault(); 1993foreach (var symbol in pair.Value) 2176private void CheckIndexerNameConflicts(BindingDiagnosticBag diagnostics, Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName) 2196foreach (var symbol in members) 2229Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName, 2279foreach (var member in this.GetMembersUnordered()) 2300foreach (var dup in GetMembers(tp.Name)) 2312foreach (Symbol symbol in this.GetMembersUnordered()) 2381foreach (var member in valuesByName) 2416var symbol = field.AssociatedSymbol ?? field; 2438foreach (var member in valuesByName) 2636foreach (var member in GetMembersUnordered()) 2653foreach (var member in GetMembersUnordered()) 2681foreach (var m in this.GetMembersUnordered()) 2725foreach (var m in t.GetMembersUnordered()) 2829private Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> MakeAllMembers(BindingDiagnosticBag diagnostics) 2831Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName; 2855Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName, 2860ImmutableArray<Symbol> typesAsSymbols = StaticCast<Symbol>.From(types); 2862ImmutableArray<Symbol> membersForName; 2876public ArrayBuilder<Symbol> NonTypeMembers = ArrayBuilder<Symbol>.GetInstance(); 2937public readonly ImmutableArray<Symbol> NonTypeMembers; 2953ImmutableArray<Symbol> nonTypeMembers, 3016private ArrayBuilder<Symbol>? NonTypeMembers; 3125public IReadOnlyCollection<Symbol> GetNonTypeMembers(DeclaredMembersAndInitializers declaredMembers) 3127return NonTypeMembers ?? (IReadOnlyCollection<Symbol>)declaredMembers.NonTypeMembers; 3130public void AddNonTypeMember(Symbol member, DeclaredMembersAndInitializers declaredMembers) 3134NonTypeMembers = ArrayBuilder<Symbol>.GetInstance(declaredMembers.NonTypeMembers.Length + 1); 3141public void SetNonTypeMembers(ArrayBuilder<Symbol> members) 3358ImmutableArray<Symbol> nonTypeMembersToCheck; 3377foreach (var member in nonTypeMembersToCheck) 3404internal ImmutableArray<Symbol> GetMembersToMatchAgainstDeclarationSpan() 3420internal ImmutableArray<Symbol> GetCandidateMembersForLookup(string name) 3428ImmutableArray<Symbol> nonTypeMembersToCheck; 3451ImmutableArray<Symbol> types = GetTypeMembers(name).Cast<NamedTypeSymbol, Symbol>(); 3452ArrayBuilder<Symbol>? memberBuilder = null; 3454foreach (var member in nonTypeMembersToCheck) 3463memberBuilder ??= ArrayBuilder<Symbol>.GetInstance(types.Length + 1); 3598ref Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName, 3605var membersBySignature = new Dictionary<Symbol, Symbol>(MemberSignatureComparer.PartialMethodsComparer); 3610foreach (var symbol in membersByName[name]) 3617if (!membersBySignature.TryGetValue(symbol, out var prev)) 3645foreach (var symbol in membersBySignature.Values) 3682void mergePartialMethods(ref Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName, ReadOnlyMemory<char> name, SourceOrdinaryMethodSymbol currentMethod, SourceOrdinaryMethodSymbol prevMethod, BindingDiagnosticBag diagnostics) 3703void mergePartialProperties(ref Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName, ReadOnlyMemory<char> name, SourcePropertySymbol currentProperty, SourcePropertySymbol prevProperty, BindingDiagnosticBag diagnostics) 3728void mergeAccessors(ref Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName, SourcePropertyAccessorSymbol? currentAccessor, SourcePropertyAccessorSymbol? prevAccessor) 3755private void DuplicateMembersByNameIfCached(ref Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName) 3760membersByName = new Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>>(membersByName, ReadOnlyMemoryOfCharComparer.Instance); 3765private static ImmutableArray<Symbol> FixPartialMethod(ImmutableArray<Symbol> symbols, SourceOrdinaryMethodSymbol part1, SourceOrdinaryMethodSymbol part2) 3787private static void FixPartialProperty(ref Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName, ReadOnlyMemory<char> name, SourcePropertySymbol part1, SourcePropertySymbol part2) 3815private static ImmutableArray<Symbol> Remove(ImmutableArray<Symbol> symbols, Symbol symbol) 3817var builder = ArrayBuilder<Symbol>.GetInstance(); 3818foreach (var s in symbols) 3853foreach (var symbol in GetMembers(accessorName)) 3889foreach (var symbol in GetMembers(accessorName)) 3917var locationFrom = (Symbol)(getNotSet ? propertySymbol.GetMethod : propertySymbol.SetMethod) ?? propertySymbol; 3926var locationFrom = (Symbol?)(isAdder ? propertySymbol.AddMethod : propertySymbol.RemoveMethod) ?? propertySymbol; 4037private static void CheckInterfaceMembers(ImmutableArray<Symbol> nonTypeMembers, BindingDiagnosticBag diagnostics) 4039foreach (var member in nonTypeMembers) 4045private static void CheckInterfaceMember(Symbol member, BindingDiagnosticBag diagnostics) 4093ArrayBuilder<Symbol> members, 4139var symbol = initializer.FieldOpt.AssociatedSymbol ?? initializer.FieldOpt; 4167var members = ArrayBuilder<Symbol>.GetInstance(membersSoFar.Count + 1); 4187var fieldsByName = PooledDictionary<string, Symbol>.GetInstance(); 4189foreach (var member in membersSoFar) 4280void addDeconstruct(SynthesizedPrimaryConstructor ctor, ImmutableArray<Symbol> positionalMembers) 4303if (!memberSignatures.TryGetValue(targetMethod, out Symbol? existingDeconstructMethod)) 4351if (!memberSignatures.TryGetValue(targetMethod, out Symbol? existingConstructor)) 4378MethodSymbol addPrintMembersMethod(IEnumerable<Symbol> userDefinedMembers) 4400if (!memberSignatures.TryGetValue(targetMethod, out Symbol? existingPrintMembersMethod)) 4471if (!memberSignatures.TryGetValue(targetMethod, out Symbol? existingToStringMethod)) 4494var objectToString = this.DeclaringCompilation.GetSpecialTypeMember(SpecialMember.System_Object__ToString); 4498foreach (var member in currentBaseType.GetSimpleNonTypeMembers(WellKnownMemberNames.ObjectToString)) 4514ImmutableArray<Symbol> addProperties(ImmutableArray<ParameterSymbol> recordParameters) 4516var existingOrAddedMembers = ArrayBuilder<Symbol>.GetInstance(recordParameters.Length); 4596bool checkMemberNotHidden(Symbol symbol, ParameterSymbol param) 4630if (!memberSignatures.TryGetValue(targetMethod, out Symbol? existingHashCodeMethod)) 4660if (!memberSignatures.TryGetValue(targetProperty, out Symbol? existingEqualityContractProperty)) 4729if (!memberSignatures.TryGetValue(targetMethod, out Symbol? existingEqualsMethod)) 4754void reportStaticOrNotOverridableAPIInRecord(Symbol symbol, BindingDiagnosticBag diagnostics) 4795foreach (var member in membersSoFar) 5255private void AddAccessorIfAvailable(ArrayBuilder<Symbol> symbols, MethodSymbol? accessorOpt) 5296foreach (var member in GetMembersUnordered()) 5409foreach (var member in this.GetMembersUnordered())
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (32)
100foreach (var abstractMember in this.AbstractMembers) 134foreach (var interfaceMember in @interface.GetMembers()) 158MultiDictionary<Symbol, Symbol>.ValueSet explicitImpl = this.GetExplicitImplementationForInterfaceMember(interfaceMember); 178var implementingMember = implementingMemberAndDiagnostics.Symbol; 229var info = new CSDiagnosticInfo(ErrorCode.ERR_MixingWinRTEventWithRegular, args, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<Location>(this.GetFirstLocation())); 237var associatedPropertyOrEvent = interfaceMemberKind == SymbolKind.Method ? ((MethodSymbol)interfaceMember).AssociatedSymbol : null; 385private bool ReportAccessorOfInterfacePropertyOrEvent(Symbol interfacePropertyOrEvent) 395Symbol implementingPropertyOrEvent; 399MultiDictionary<Symbol, Symbol>.ValueSet explicitImpl = this.GetExplicitImplementationForInterfaceMember(interfacePropertyOrEvent); 527foreach (var member in this.GetMembersUnordered()) 669private void CheckNewModifier(Symbol symbol, bool isNew, BindingDiagnosticBag diagnostics) 701foreach (var hiddenMember in currType.GetMembers(symbol.Name)) 741Symbol overridingMember, 778Symbol associatedPropertyOrEvent = null; 867void checkSingleOverriddenMember(Symbol overridingMember, Symbol overriddenMember, BindingDiagnosticBag diagnostics, ref bool suppressAccessors) 924var leastOverriddenMember = overriddenMember.GetLeastOverriddenMember(overriddenMember.ContainingType); 1198private bool IsValidOverrideReturnType(Symbol overridingSymbol, TypeWithAnnotations overridingReturnType, TypeWithAnnotations overriddenReturnType, BindingDiagnosticBag diagnostics) 1519Symbol overriddenMember, 1520Symbol overridingMember) 1551Symbol hidingMember, 1581foreach (var hiddenMember in hiddenMembers) 1630private static bool IsShadowingSynthesizedRecordMember(Symbol hidingMember) 1639private static bool AddHidingAbstractDiagnostic(Symbol hidingMember, Location hidingMemberLocation, Symbol hiddenMember, BindingDiagnosticBag diagnostics, ref bool suppressAccessors) 1674var associatedPropertyOrEvent = ((MethodSymbol)hidingMember).AssociatedSymbol; 1705private static bool OverrideHasCorrectAccessibility(Symbol overridden, Symbol overriding) 1793SynthesizeInterfaceMemberImplementation(SymbolAndDiagnostics implementingMemberAndDiagnostics, Symbol interfaceMember) 1803Symbol implementingMember = implementingMemberAndDiagnostics.Symbol;
Symbols\Source\SourceMemberFieldSymbol.cs (3)
147public override Symbol AssociatedSymbol 270internal sealed override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken) 462Symbol associatedPropertyOrEvent = this.AssociatedSymbol;
Symbols\Source\SourceMemberMethodSymbol.cs (3)
492public sealed override Symbol ContainingSymbol 508public override Symbol AssociatedSymbol 861internal override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken)
Symbols\Source\SourceModuleSymbol.cs (5)
167foreach (Symbol s in ns.GetMembersUnordered()) 225internal override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken) 382foreach (var member in @namespace.GetMembers()) 431public override Symbol ContainingSymbol 606foreach (var member in ns.GetMembersUnordered())
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1803foreach (var member in GetMembers())
Symbols\Source\SourceNamespaceSymbol.cs (12)
26private readonly Symbol _container; 33private ImmutableArray<Symbol> _lazyAllMembers; 54SourceModuleSymbol module, Symbol container, 70public override Symbol ContainingSymbol 135internal override ImmutableArray<Symbol> GetMembersUnordered() 141var members = StaticCast<Symbol>.From(this.GetNameToMembersMap().Flatten(null)); // don't sort. 149public override ImmutableArray<Symbol> GetMembers() 171public override ImmutableArray<Symbol> GetMembers(ReadOnlyMemory<char> name) 175? members.Cast<NamespaceOrTypeSymbol, Symbol>() 176: ImmutableArray<Symbol>.Empty; 293var memberOfArity = new Symbol[10]; 316var other = memberOfArity[arity];
Symbols\Source\SourceNamespaceSymbol_Completion.cs (3)
13internal override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken) 67foreach (var member in members) 78foreach (var member in members)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (2)
246var attributeConstructor = Binder.GetWellKnownTypeMember(DeclaringCompilation, WellKnownMember.System_Runtime_CompilerServices_ExtensionAttribute__ctor, out var useSiteInfo); 430internal sealed override void ForceComplete(SourceLocation locationOpt, Predicate<Symbol> filter, CancellationToken cancellationToken)
Symbols\Source\SourceParameterSymbol.cs (3)
32Symbol owner, 103Symbol owner, 173internal override void ForceComplete(SourceLocation locationOpt, Predicate<Symbol> filter, CancellationToken cancellationToken)
Symbols\Source\SourceParameterSymbolBase.cs (4)
18private readonly Symbol _containingSymbol; 21public SourceParameterSymbolBase(Symbol containingSymbol, int ordinal) 29public sealed override bool Equals(Symbol obj, TypeCompareKind compareKind) 57public sealed override Symbol ContainingSymbol
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
315public sealed override Symbol AssociatedSymbol
Symbols\Source\SourcePropertyClonedParameterSymbolForAccessors.cs (1)
12internal SourcePropertyClonedParameterSymbolForAccessors(SourceParameterSymbol originalParam, Symbol newOwner)
Symbols\Source\SourcePropertySymbol.cs (1)
166internal override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken)
Symbols\Source\SourcePropertySymbolBase.cs (2)
503public override Symbol ContainingSymbol 1727internal override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken)
Symbols\Source\SourceSimpleParameterSymbol.cs (2)
21Symbol owner, 33Symbol owner,
Symbols\Source\SourceTypeParameterSymbol.cs (4)
349internal override void ForceComplete(SourceLocation locationOpt, Predicate<Symbol> filter, CancellationToken cancellationToken) 479public override Symbol ContainingSymbol 626public override Symbol ContainingSymbol 889public override Symbol ContainingSymbol
Symbols\Source\ThisParameterSymbol.cs (2)
171public override Symbol ContainingSymbol 173get { return (Symbol?)_containingMethod ?? _containingType; }
Symbols\Source\TypeParameterConstraintClause.cs (2)
169Symbol container = thisTypeParameter.ContainingSymbol; 229Symbol container = thisTypeParameter.ContainingSymbol;
Symbols\SpecializedSymbolCollections.cs (4)
13public static PooledHashSet<TSymbol> GetPooledSymbolHashSetInstance<TSymbol>() where TSymbol : Symbol 20private static class PooledSymbolHashSet<TSymbol> where TSymbol : Symbol 25public static PooledDictionary<KSymbol, V> GetPooledSymbolDictionaryInstance<KSymbol, V>() where KSymbol : Symbol 32private static class PooledSymbolDictionary<TSymbol, V> where TSymbol : Symbol
Symbols\SubstitutedEventSymbol.cs (1)
38public override Symbol ContainingSymbol
Symbols\SubstitutedFieldSymbol.cs (4)
38public override Symbol ContainingSymbol 82public override Symbol AssociatedSymbol 86Symbol underlying = OriginalDefinition.AssociatedSymbol; 111public override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\SubstitutedMethodSymbol.cs (6)
23private readonly Symbol _containingSymbol; 46protected SubstitutedMethodSymbol(Symbol containingSymbol, TypeMap map, MethodSymbol originalDefinition, MethodSymbol constructedFrom) 189public sealed override Symbol ContainingSymbol 218public sealed override Symbol AssociatedSymbol 222Symbol underlying = OriginalDefinition.AssociatedSymbol; 425public sealed override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\SubstitutedNamedTypeSymbol.cs (31)
26private static readonly Func<Symbol, NamedTypeSymbol, Symbol> s_symbolAsMemberFunc = SymbolExtensions.SymbolAsMember; 37private readonly Symbol _newContainer; 48private ConcurrentCache<string, ImmutableArray<Symbol>> _lazyMembersByNameCache; 50private ImmutableArray<Symbol> _lazyMembers; 52protected SubstitutedNamedTypeSymbol(Symbol newContainer, TypeMap map, NamedTypeSymbol originalDefinition, NamedTypeSymbol constructedFrom = null, bool unbound = false, TupleExtraData tupleData = null) 121public sealed override Symbol ContainingSymbol 184internal abstract override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes); 231public sealed override ImmutableArray<Symbol> GetMembers() 238var builder = ArrayBuilder<Symbol>.GetInstance(); 243foreach (var t in OriginalDefinition.GetMembers()) 253foreach (var t in OriginalDefinition.GetMembers()) 266private ArrayBuilder<Symbol> AddOrWrapTupleMembersIfNecessary(ArrayBuilder<Symbol> builder) 271var replacedFields = new HashSet<Symbol>(ReferenceEqualityComparer.Instance); 287internal sealed override ImmutableArray<Symbol> GetMembersUnordered() 289var builder = ArrayBuilder<Symbol>.GetInstance(); 293foreach (var t in OriginalDefinition.GetMembersUnordered()) 303foreach (var t in OriginalDefinition.GetMembersUnordered()) 314public sealed override ImmutableArray<Symbol> GetMembers(string name) 316if (_unbound) return StaticCast<Symbol>.From(GetTypeMembers(name)); 318ImmutableArray<Symbol> result; 328private ImmutableArray<Symbol> GetMembersWorker(string name) 343var builder = ArrayBuilder<Symbol>.GetInstance(originalMembers.Length); 344foreach (var t in originalMembers) 353void cacheResult(ImmutableArray<Symbol> result) 359(_lazyMembersByNameCache = new ConcurrentCache<string, ImmutableArray<Symbol>>(8)); 387internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() 394internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) 398var builder = ArrayBuilder<Symbol>.GetInstance(); 399foreach (var t in OriginalDefinition.GetEarlyAttributeDecodingMembers(name))
Symbols\SubstitutedParameterSymbol.cs (6)
15private readonly Symbol _containingSymbol; 18this((Symbol)containingSymbol, map, originalParameter) 23this((Symbol)containingSymbol, map, originalParameter) 27private SubstitutedParameterSymbol(Symbol containingSymbol, TypeMap map, ParameterSymbol originalParameter) : 40public override Symbol ContainingSymbol 101public sealed override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\SubstitutedPropertySymbol.cs (1)
39public override Symbol ContainingSymbol
Symbols\SubstitutedTypeParameterSymbol.cs (3)
19private readonly Symbol _container; 28internal SubstitutedTypeParameterSymbol(Symbol newContainer, TypeMap map, TypeParameterSymbol substitutedFrom, int ordinal) 41public override Symbol ContainingSymbol
Symbols\Symbol.cs (27)
52internal virtual void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken) 109public abstract Symbol ContainingSymbol { get; } 118Symbol container = this.ContainingSymbol; 149for (var container = this.ContainingSymbol; (object)container != null; container = container.ContainingSymbol) 172var container = this.ContainingSymbol; 343var container = this.ContainingSymbol; 363public Symbol OriginalDefinition 371protected virtual Symbol OriginalSymbolDefinition 763public static bool operator ==(Symbol left, Symbol right) 785public static bool operator !=(Symbol left, Symbol right) 808return this.Equals(obj as Symbol, SymbolEqualityComparer.Default.CompareKind); 811public bool Equals(Symbol other) 818return this.Equals(other as Symbol, compareKind); 822public virtual bool Equals(Symbol other, TypeCompareKind compareKind) 833public static bool Equals(Symbol first, Symbol second, TypeCompareKind compareKind) 958internal static void ForceCompleteMemberConditionally(SourceLocation? locationOpt, Predicate<Symbol>? filter, Symbol member, CancellationToken cancellationToken) 1329internal static bool GetUnificationUseSiteDiagnosticRecursive<T>(ref DiagnosticInfo result, ImmutableArray<T> types, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) where T : TypeSymbol 1342internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeWithAnnotations> types, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1355internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<CustomModifier> modifiers, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1368internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<ParameterSymbol> parameters, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1382internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeParameterSymbol> typeParameters, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1702internal static bool IsCaptured(Symbol variable, SourceMethodSymbol containingSymbol) 1746for (var currentFunction = variable.ContainingSymbol;
Symbols\SymbolCompletionState.cs (2)
43/// of <see cref="Symbol.GetAttributes"/> will set the part <see cref="CompletionPart.Attributes"/> on 48internal void DefaultForceComplete(Symbol symbol, CancellationToken cancellationToken)
Symbols\SymbolDistinguisher.cs (11)
28private readonly Symbol _symbol0; 29private readonly Symbol _symbol1; 33public SymbolDistinguisher(CSharpCompilation compilation, Symbol symbol0, Symbol symbol1) 55private static void CheckSymbolKind(Symbol symbol) 96Symbol unwrappedSymbol0 = UnwrapSymbol(_symbol0); 97Symbol unwrappedSymbol1 = UnwrapSymbol(_symbol1); 140private static Symbol UnwrapSymbol(Symbol symbol) 161private static string GetLocationString(CSharpCompilation compilation, Symbol unwrappedSymbol) 217private Symbol GetSymbol()
Symbols\SymbolEqualityComparer.cs (13)
12internal sealed class SymbolEqualityComparer : EqualityComparer<Symbol> 14internal static readonly EqualityComparer<Symbol> ConsiderEverything = new SymbolEqualityComparer(TypeCompareKind.ConsiderEverything); 16internal static readonly EqualityComparer<Symbol> IgnoringTupleNamesAndNullability = new SymbolEqualityComparer(TypeCompareKind.IgnoreTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes); 18internal static EqualityComparer<Symbol> IncludeNullability => ConsiderEverything; 23internal static readonly EqualityComparer<Symbol> IgnoringDynamicTupleNamesAndNullability = new SymbolEqualityComparer(TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes); 25internal static readonly EqualityComparer<Symbol> IgnoringNullable = new SymbolEqualityComparer(TypeCompareKind.IgnoreNullableModifiersForReferenceTypes); 27internal static readonly EqualityComparer<Symbol> ObliviousNullableModifierMatchesAny = new SymbolEqualityComparer(TypeCompareKind.ObliviousNullableModifierMatchesAny); 29internal static readonly EqualityComparer<Symbol> AllIgnoreOptions = new SymbolEqualityComparer(TypeCompareKind.AllIgnoreOptions); 31internal static readonly EqualityComparer<Symbol> AllIgnoreOptionsPlusNullableWithUnknownMatchesAny = 34internal static readonly EqualityComparer<Symbol> CLRSignature = new SymbolEqualityComparer(TypeCompareKind.CLRSignatureCompareOptions); 43public override int GetHashCode(Symbol obj) 48public override bool Equals(Symbol x, Symbol y)
Symbols\SymbolExtensions.cs (56)
24public static bool IsCompilationOutputWinMdObj(this Symbol symbol) 39public static bool IsNestedType([NotNullWhen(true)] this Symbol? symbol) 87public static bool IsNoMoreVisibleThan(this Symbol symbol, TypeSymbol type, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 92public static bool IsNoMoreVisibleThan(this Symbol symbol, TypeWithAnnotations type, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 97internal static void AddUseSiteInfo(this Symbol? symbol, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool addDiagnostics = true) 120public static LocalizableErrorArgument GetKindText(this Symbol symbol) 129internal static NamespaceOrTypeSymbol? ContainingNamespaceOrType(this Symbol symbol) 131var containingSymbol = symbol.ContainingSymbol; 145internal static Symbol? ContainingNonLambdaMember(this Symbol? containingMember) 157internal static ParameterSymbol? EnclosingThisSymbol(this Symbol containingMember) 159Symbol symbol = containingMember; 199public static Symbol ConstructedFrom(this Symbol symbol) 232public static bool IsContainingSymbolOfAllTypeParameters(this Symbol containingSymbol, TypeSymbol type) 241public static bool IsContainingSymbolOfAllTypeParameters(this Symbol containingSymbol, ImmutableArray<TypeSymbol> types) 246private static readonly Func<TypeSymbol, Symbol, bool, bool> s_hasInvalidTypeParameterFunc = 249private static bool HasInvalidTypeParameter(TypeSymbol type, Symbol? containingSymbol) 253var symbol = type.ContainingSymbol; 266public static bool IsTypeOrTypeAlias(this Symbol symbol) 286internal static bool CompilationAllowsUnsafe(this Symbol symbol) 291internal static void CheckUnsafeModifier(this Symbol symbol, DeclarationModifiers modifiers, BindingDiagnosticBag diagnostics) 296internal static void CheckUnsafeModifier(this Symbol symbol, DeclarationModifiers modifiers, Location errorLocation, BindingDiagnosticBag diagnostics) 299internal static void CheckUnsafeModifier(this Symbol symbol, DeclarationModifiers modifiers, Location errorLocation, DiagnosticBag? diagnostics) 313public static bool IsHiddenByCodeAnalysisEmbeddedAttribute(this Symbol symbol) 330public static bool MustCallMethodsDirectly(this Symbol symbol) 343public static int GetArity(this Symbol? symbol) 359internal static CSharpSyntaxNode GetNonNullSyntaxNode(this Symbol? symbol) 367Symbol? containingSymbol = symbol.ContainingSymbol; 384internal static Symbol? EnsureCSharpSymbolOrNull(this ISymbol? symbol, string paramName) 443internal static TypeWithAnnotations GetTypeOrReturnType(this Symbol symbol) 475internal static FlowAnalysisAnnotations GetFlowAnalysisAnnotations(this Symbol? symbol) 487internal static void GetTypeOrReturnType(this Symbol symbol, out RefKind refKind, out TypeWithAnnotations returnType, 538internal static bool IsImplementableInterfaceMember(this Symbol symbol) 543internal static bool RequiresInstanceReceiver(this Symbol symbol) 556private static TISymbol? GetPublicSymbol<TISymbol>(this Symbol? symbol) 563internal static ISymbol? GetPublicSymbol(this Symbol? symbol) 688internal static IEnumerable<ISymbol?> GetPublicSymbols(this IEnumerable<Symbol?> symbols) 693private static ImmutableArray<TISymbol> GetPublicSymbols<TISymbol>(this ImmutableArray<Symbol> symbols) 704internal static ImmutableArray<ISymbol> GetPublicSymbols(this ImmutableArray<Symbol> symbols) 711return GetPublicSymbols<IPropertySymbol>(StaticCast<Symbol>.From(symbols)); 716return GetPublicSymbols<ITypeSymbol>(StaticCast<Symbol>.From(symbols)); 721return GetPublicSymbols<INamedTypeSymbol>(StaticCast<Symbol>.From(symbols)); 726return GetPublicSymbols<ILocalSymbol>(StaticCast<Symbol>.From(symbols)); 731return GetPublicSymbols<IEventSymbol>(StaticCast<Symbol>.From(symbols)); 736return GetPublicSymbols<ITypeParameterSymbol>(StaticCast<Symbol>.From(symbols)); 741return GetPublicSymbols<IParameterSymbol>(StaticCast<Symbol>.From(symbols)); 746return GetPublicSymbols<IMethodSymbol>(StaticCast<Symbol>.From(symbols)); 751return GetPublicSymbols<IAssemblySymbol>(StaticCast<Symbol>.From(symbols)); 756return GetPublicSymbols<IFieldSymbol>(StaticCast<Symbol>.From(symbols)); 761return GetPublicSymbols<INamespaceSymbol>(StaticCast<Symbol>.From(symbols)); 766where TSymbol : Symbol 772internal static Symbol? GetSymbol(this ISymbol? symbol) 774return symbol.GetSymbol<Symbol>(); 825internal static bool IsRequired(this Symbol symbol) => symbol is FieldSymbol { IsRequired: true } or PropertySymbol { IsRequired: true }; 830internal static int GetOverloadResolutionPriority(this Symbol symbol)
Symbols\SymbolVisitor.cs (2)
13public virtual void Visit(Symbol symbol) 21public virtual void DefaultVisit(Symbol symbol)
Symbols\SymbolVisitor`1.cs (2)
13public virtual TResult Visit(Symbol symbol) 20public virtual TResult DefaultVisit(Symbol symbol)
Symbols\SymbolVisitor`2.cs (3)
24public virtual TResult Visit(Symbol symbol, TArgument argument = default(TArgument)) 35/// The default Visit method called when visiting any <see cref="Symbol" /> and 41public virtual TResult DefaultVisit(Symbol symbol, TArgument argument)
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (8)
20private readonly ImmutableArray<Symbol> _members; 43var membersBuilder = ArrayBuilder<Symbol>.GetInstance(); 112static void addProperty(ArrayBuilder<Symbol> builder, PropertySymbol property) 144public override Symbol ContainingSymbol => _containingType; 200public override ImmutableArray<Symbol> GetMembers() => _members; 202public override ImmutableArray<Symbol> GetMembers(string name) => GetMembers().WhereAsArray(static (m, name) => m.Name == name, name); 222internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() => throw ExceptionUtilities.Unreachable(); 224internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) => throw ExceptionUtilities.Unreachable();
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (1)
49public override Symbol ContainingSymbol => _containingType;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeParameterSymbol.cs (1)
45public override Symbol ContainingSymbol => _containingType;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (12)
234var symbol = compilation.GetSpecialTypeMember(member); 245var symbol = Binder.GetWellKnownTypeMember(compilation, member, out var useSiteInfo); 258private readonly ImmutableArray<Symbol> _members; 313var membersBuilder = ArrayBuilder<Symbol>.GetInstance(); 728static void addProperty(ArrayBuilder<Symbol> builder, PropertySymbol property) 768private Symbol GetFieldTypeMember(WellKnownMember member) 770var symbol = DeclaringCompilation.GetWellKnownTypeMember(member); 821public override Symbol? ContainingSymbol => _containingModule.GlobalNamespace; 877public override ImmutableArray<Symbol> GetMembers() => _members; 879public override ImmutableArray<Symbol> GetMembers(string name) => GetMembers().WhereAsArray(static (m, name) => m.Name == name, name); 904internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() => throw ExceptionUtilities.Unreachable(); 906internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) => throw ExceptionUtilities.Unreachable();
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (2)
39public override Symbol? AssociatedSymbol 62public override Symbol ContainingSymbol
Symbols\Synthesized\Records\SynthesizedRecordClone.cs (1)
158foreach (var member in containingType.GetMembers(WellKnownMemberNames.CloneMethodName))
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (1)
133internal static bool IsCopyConstructor(Symbol member)
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (5)
16private readonly ImmutableArray<Symbol> _positionalMembers; 21ImmutableArray<Symbol> positionalMembers, 64var positionalMember = _positionalMembers[i]; 98private static bool IsReadOnly(SourceMemberContainerTypeSymbol containingType, ImmutableArray<Symbol> positionalMembers) 102static bool hasNonReadOnlyGetter(Symbol m)
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperator.cs (1)
43foreach (var member in ContainingType.GetMembers(WellKnownMemberNames.ObjectEquals))
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (9)
25IEnumerable<Symbol> userDefinedMembers, 35private static DeclarationModifiers MakeDeclarationModifiers(SourceMemberContainerTypeSymbol containingType, IEnumerable<Symbol> userDefinedMembers) 121ImmutableArray<Symbol> printableMembers = ContainingType.GetMembers().WhereAsArray(m => isPrintable(m)); 190var member = printableMembers[i]; 241static bool isPrintable(Symbol m) 294private static bool IsReadOnly(NamedTypeSymbol containingType, IEnumerable<Symbol> userDefinedMembers) 299private static bool AreAllPrintablePropertyGettersReadOnly(IEnumerable<Symbol> members) 301foreach (var member in members) 324private static bool IsPublicInstanceMember(Symbol m)
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (2)
112public override Symbol AssociatedSymbol 148public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedContainer.cs (9)
115public override ImmutableArray<Symbol> GetMembers() 117Symbol constructor = this.Constructor; 118return (object)constructor == null ? ImmutableArray<Symbol>.Empty : ImmutableArray.Create(constructor); 121public override ImmutableArray<Symbol> GetMembers(string name) 124return ((object)ctor != null && name == ctor.Name) ? ImmutableArray.Create<Symbol>(ctor) : ImmutableArray<Symbol>.Empty; 129foreach (var m in this.GetMembers()) 140internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() => this.GetMembersUnordered(); 142internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) => this.GetMembers(name);
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (2)
193public override Symbol? AssociatedSymbol 213public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (8)
76public override Symbol ContainingSymbol => _namespace; 141public override ImmutableArray<Symbol> GetMembers() => Constructors.CastArray<Symbol>(); 143public override ImmutableArray<Symbol> GetMembers(string name) => name == WellKnownMemberNames.InstanceConstructorName ? Constructors.CastArray<Symbol>() : ImmutableArray<Symbol>.Empty; 159internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() => GetMembers(); 161internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) => GetMembers(name);
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
62public override Symbol ContainingSymbol 130public override Symbol AssociatedSymbol
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (2)
97public override Symbol AssociatedSymbol 145public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (2)
77public sealed override Symbol ContainingSymbol 229public override Symbol AssociatedSymbol
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (6)
29private readonly ImmutableArray<Symbol> _members; 53public override ImmutableArray<Symbol> GetMembers() 56public override ImmutableArray<Symbol> GetMembers(string name) 93public override Symbol ContainingSymbol => _namespace; 125internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() => GetMembers(); 126internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) => GetMembers(name);
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
115public sealed override Symbol ContainingSymbol 151public sealed override Symbol AssociatedSymbol
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (7)
69public override Symbol? ContainingSymbol => _containingModule.GlobalNamespace; 131public override ImmutableArray<Symbol> GetMembers() => ImmutableArray<Symbol>.CastUp(_fields); 133public override ImmutableArray<Symbol> GetMembers(string name) => GetMembers().WhereAsArray(m => m.Name == name); 153internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() => throw ExceptionUtilities.Unreachable(); 155internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) => throw ExceptionUtilities.Unreachable(); 237public override Symbol ContainingSymbol => _container;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (2)
55public sealed override Symbol ContainingSymbol 173public sealed override Symbol AssociatedSymbol
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (2)
49public override Symbol AssociatedSymbol 54public override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (4)
283public override Symbol AssociatedSymbol 312public override Symbol ContainingSymbol 423public override bool Equals(Symbol obj, TypeCompareKind compareKind) 476public override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\Synthesized\SynthesizedLocal.cs (1)
128public sealed override Symbol ContainingSymbol
Symbols\Synthesized\SynthesizedParameterSymbol.cs (8)
18private readonly Symbol? _container; 26Symbol? container, 130public override Symbol? ContainingSymbol 233Symbol symbol => symbol.ContainingModule.UseUpdatedEscapeRules, 241Symbol? container, 256Symbol? container, 305internal static ParameterSymbol DeriveParameter(Symbol destination, ParameterSymbol oldParam) 345Symbol? container,
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (9)
62public override Symbol ContainingSymbol => _globalNamespace; 114public override ImmutableArray<Symbol> GetMembers() => ImmutableArray<Symbol>.Empty; 116public override ImmutableArray<Symbol> GetMembers(string name) => ImmutableArray<Symbol>.Empty; 145internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers() => ImmutableArray<Symbol>.Empty; 147internal override ImmutableArray<Symbol> GetEarlyAttributeDecodingMembers(string name) => ImmutableArray<Symbol>.Empty;
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (2)
48public override Symbol ContainingSymbol 246public override Symbol AssociatedSymbol
Symbols\Synthesized\SynthesizedStaticConstructor.cs (2)
22public override Symbol ContainingSymbol 165public override Symbol? AssociatedSymbol
Symbols\Synthesized\SynthesizedSubstitutedTypeParameterSymbol.cs (1)
19public SynthesizedSubstitutedTypeParameterSymbol(Symbol owner, TypeMap map, TypeParameterSymbol substitutedFrom, int ordinal)
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (3)
18private readonly Symbol _containingSymbol; 20public TypeSubstitutedLocalSymbol(LocalSymbol originalVariable, TypeWithAnnotations type, Symbol containingSymbol) 57public override Symbol ContainingSymbol
Symbols\SynthesizedNamespaceSymbol.cs (6)
36public override bool Equals(Symbol obj, TypeCompareKind compareKind) 55public override Symbol ContainingSymbol 76public override ImmutableArray<Symbol> GetMembers() 77=> ImmutableArray<Symbol>.Empty; 79public override ImmutableArray<Symbol> GetMembers(ReadOnlyMemory<char> name) 80=> ImmutableArray<Symbol>.Empty;
Symbols\SynthesizedSimpleMethodTypeParameterSymbol.cs (1)
91public override Symbol ContainingSymbol
Symbols\Tuples\TupleErrorFieldSymbol.cs (1)
176public override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\Tuples\TupleFieldSymbol.cs (4)
96public sealed override Symbol? AssociatedSymbol 117public sealed override Symbol ContainingSymbol 148internal override void ForceComplete(SourceLocation? locationOpt, Predicate<Symbol>? filter, CancellationToken cancellationToken) 158public sealed override bool Equals(Symbol obj, TypeCompareKind compareKind)
Symbols\Tuples\TupleTypeSymbol.cs (29)
487internal static Symbol? GetWellKnownMemberInType(NamedTypeSymbol type, WellKnownMember relativeMember, BindingDiagnosticBag diagnostics, SyntaxNode? syntax) 489Symbol? member = GetWellKnownMemberInType(type, relativeMember); 516static Symbol? GetWellKnownMemberInType(NamedTypeSymbol type, WellKnownMember relativeMember) 565public TMember? GetTupleMemberSymbolForUnderlyingMember<TMember>(TMember? underlyingMemberOpt) where TMember : Symbol 570protected ArrayBuilder<Symbol> MakeSynthesizedTupleMembers(ImmutableArray<Symbol> currentMembers, HashSet<Symbol>? replacedFields = null) 577var members = ArrayBuilder<Symbol>.GetInstance(currentMembers.Length); 591foreach (Symbol member in currentMembers) 799static void collectTargetTupleFields(int arity, ImmutableArray<Symbol> members, ArrayBuilder<FieldSymbol?> fieldsForElements) 810static Symbol? getWellKnownMemberInType(ImmutableArray<Symbol> members, WellKnownMember relativeMember) 819static ImmutableArray<Symbol> getOriginalFields(ImmutableArray<Symbol> members) 821var fields = ArrayBuilder<Symbol>.GetInstance(); 822foreach (var member in members) 913private SmallDictionary<Symbol, Symbol>? _lazyUnderlyingDefinitionToMemberMap; 1014foreach (var member in tuple.GetMembers()) 1045internal SmallDictionary<Symbol, Symbol> UnderlyingDefinitionToMemberMap 1051SmallDictionary<Symbol, Symbol> computeDefinitionToMemberMap() 1053var map = new SmallDictionary<Symbol, Symbol>(ReferenceEqualityComparer.Instance); 1060var member = members[i]; 1100public TMember? GetTupleMemberSymbolForUnderlyingMember<TMember>(TMember? underlyingMemberOpt) where TMember : Symbol 1107Symbol underlyingMemberDefinition = underlyingMemberOpt.OriginalDefinition; 1115if (UnderlyingDefinitionToMemberMap.TryGetValue(underlyingMemberDefinition, out Symbol? result))
Symbols\TypeMap.cs (3)
103private TypeMap WithAlphaRename(ImmutableArray<TypeParameterSymbol> oldTypeParameters, Symbol newOwner, out ImmutableArray<TypeParameterSymbol> newTypeParameters) 145internal TypeMap WithAlphaRename(MethodSymbol oldOwner, Symbol newOwner, out ImmutableArray<TypeParameterSymbol> newTypeParameters) 153Symbol newOwner,
Symbols\TypeParameterSymbol.cs (5)
143public sealed override ImmutableArray<Symbol> GetMembers() 145return ImmutableArray<Symbol>.Empty; 149public sealed override ImmutableArray<Symbol> GetMembers(string name) 151return ImmutableArray<Symbol>.Empty; 645internal sealed override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\TypeSymbol.cs (131)
42private ImmutableHashSet<Symbol> _lazyAbstractMembers; 60private ConcurrentDictionary<Symbol, SymbolAndDiagnostics> _implementationForInterfaceMemberMap; 62public ConcurrentDictionary<Symbol, SymbolAndDiagnostics> ImplementationForInterfaceMemberMap 73map = new ConcurrentDictionary<Symbol, SymbolAndDiagnostics>(concurrencyLevel: 1, capacity: 1, comparer: SymbolEqualityComparer.ConsiderEverything); 83internal MultiDictionary<Symbol, Symbol> explicitInterfaceImplementationMap; 146protected sealed override Symbol OriginalSymbolDefinition 298public sealed override bool Equals(Symbol other, TypeCompareKind compareKind) 442public Symbol FindImplementationForInterfaceMember(Symbol interfaceMember) 531internal abstract bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes); 720internal SymbolAndDiagnostics FindImplementationForInterfaceMemberInNonInterfaceWithDiagnostics(Symbol interfaceMember, bool ignoreImplementationInInterfacesIfResultIsNotReady = false) 771internal Symbol FindImplementationForInterfaceMemberInNonInterface(Symbol interfaceMember, bool ignoreImplementationInInterfacesIfResultIsNotReady = false) 776private SymbolAndDiagnostics ComputeImplementationAndDiagnosticsForInterfaceMember(Symbol interfaceMember, bool ignoreImplementationInInterfaces, out bool implementationInInterfacesMightChangeResult) 779var implementingMember = ComputeImplementationForInterfaceMember(interfaceMember, this, diagnostics, ignoreImplementationInInterfaces, out implementationInInterfacesMightChangeResult); 802private static Symbol ComputeImplementationForInterfaceMember(Symbol interfaceMember, TypeSymbol implementingType, BindingDiagnosticBag diagnostics, 830Symbol implicitImpl = null; 831Symbol closestMismatch = null; 846MultiDictionary<Symbol, Symbol>.ValueSet explicitImpl = currType.GetExplicitImplementationForInterfaceMember(interfaceMember); 878if (IsExplicitlyImplementedViaAccessors(checkPendingExplicitImplementations, interfaceMember, currType, ref useSiteInfo, out Symbol currTypeExplicitImpl)) 916Symbol currTypeImplicitImpl; 917Symbol currTypeCloseMismatch; 948Symbol originalImplicitImpl = implicitImpl; 958Symbol defaultImpl = null; 1048private static Symbol FindMostSpecificImplementationInInterfaces(Symbol interfaceMember, TypeSymbol implementingType, 1063Symbol defaultImpl = FindMostSpecificImplementationInBases(interfaceMember, 1065ref useSiteInfo, out Symbol conflict1, out Symbol conflict2); 1101private static Symbol FindMostSpecificImplementation(Symbol interfaceMember, NamedTypeSymbol implementingInterface, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1103MultiDictionary<Symbol, Symbol>.ValueSet implementingMember = FindImplementationInInterface(interfaceMember, implementingInterface); 1120out var _, out var _); 1123Symbol result = implementingMember.Single(); 1142private static Symbol FindMostSpecificImplementationInBases( 1143Symbol interfaceMember, 1146out Symbol conflictingImplementation1, 1147out Symbol conflictingImplementation2) 1171Symbol accessorImpl1 = findMostSpecificImplementationInBases(interfaceAccessor1 ?? interfaceAccessor2, allInterfaces, ref useSiteInfo, 1172out Symbol conflictingAccessorImplementation11, out Symbol conflictingAccessorImplementation12); 1202Symbol accessorImpl2 = findMostSpecificImplementationInBases(interfaceAccessor2, allInterfaces, ref useSiteInfo, 1203out Symbol conflictingAccessorImplementation21, out Symbol conflictingAccessorImplementation22); 1233static Symbol findImplementationInInterface(Symbol interfaceMember, Symbol inplementingAccessor1, Symbol implementingAccessor2 = null) 1243MultiDictionary<Symbol, Symbol>.ValueSet implementingMember = FindImplementationInInterface(interfaceMember, implementingInterface); 1254static Symbol findMostSpecificImplementationInBases( 1255Symbol interfaceMember, 1258out Symbol conflictingImplementation1, 1259out Symbol conflictingImplementation2) 1261var implementations = ArrayBuilder<(MultiDictionary<Symbol, Symbol>.ValueSet MethodSet, MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> Bases)>.GetInstance(); 1271MultiDictionary<Symbol, Symbol>.ValueSet candidate = FindImplementationInInterface(interfaceMember, interfaceType); 1280(MultiDictionary<Symbol, Symbol>.ValueSet methodSet, MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> bases) = implementations[i]; 1281Symbol previous = methodSet.First(); 1333Symbol result; 1343MultiDictionary<Symbol, Symbol>.ValueSet methodSet = implementations[0].MethodSet; 1373internal static MultiDictionary<Symbol, Symbol>.ValueSet FindImplementationInInterface(Symbol interfaceMember, NamedTypeSymbol interfaceType) 1387return new MultiDictionary<Symbol, Symbol>.ValueSet(interfaceMember); 1396private static (MethodSymbol interfaceAccessor1, MethodSymbol interfaceAccessor2) GetImplementableAccessors(Symbol interfaceMember) 1457private static bool IsExplicitlyImplementedViaAccessors(bool checkPendingExplicitImplementations, Symbol interfaceMember, TypeSymbol currType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out Symbol implementingMember) 1461Symbol associated1; 1462Symbol associated2; 1494private static bool TryGetExplicitImplementationAssociatedPropertyOrEvent(bool checkPendingExplicitImplementations, MethodSymbol interfaceAccessor, TypeSymbol currType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out Symbol associated) 1500MultiDictionary<Symbol, Symbol>.ValueSet set = currType.GetExplicitImplementationForInterfaceMember(interfaceAccessor); 1503Symbol implementation = set.Single(); 1539ref Symbol implicitImpl) 1544Symbol associatedInterfacePropertyOrEvent = interfaceMethod.AssociatedSymbol; 1555Symbol implementingPropertyOrEvent = implementingType.FindImplementationForInterfaceMemberInNonInterface(associatedInterfacePropertyOrEvent, 1621private static void ReportDefaultInterfaceImplementationMatchDiagnostics(Symbol interfaceMember, TypeSymbol implementingType, Symbol implicitImpl, BindingDiagnosticBag diagnostics) 1669private static void ReportImplicitImplementationMatchDiagnostics(Symbol interfaceMember, TypeSymbol implementingType, Symbol implicitImpl, BindingDiagnosticBag diagnostics) 1724foreach (Symbol member in implicitImpl.ContainingType.GetMembers(implicitImpl.Name)) 1764internal static void CheckModifierMismatchOnImplementingMember(TypeSymbol implementingType, Symbol implementingMember, Symbol interfaceMember, bool isExplicit, BindingDiagnosticBag diagnostics) 1962static void checkRefStructInterfacesFeatureAvailabilityOnUnscopedRefAttribute(Symbol implementingSymbol, BindingDiagnosticBag diagnostics) 1981private static void ReportImplicitImplementationMismatchDiagnostics(Symbol interfaceMember, TypeSymbol implementingType, Symbol closestMismatch, BindingDiagnosticBag diagnostics) 2053internal static bool HaveInitOnlyMismatch(Symbol one, Symbol other) 2071private static Location GetInterfaceLocation(Symbol interfaceMember, TypeSymbol implementingType) 2130internal static Location GetImplicitImplementationDiagnosticLocation(Symbol interfaceMember, TypeSymbol implementingType, Symbol member) 2160Symbol interfaceMember, 2163out Symbol implicitImpl, 2164out Symbol closeMismatch) 2176foreach (Symbol member in currType.GetMembers(interfaceMember.Name)) 2233private static bool IsInterfaceMemberImplementation(Symbol candidateMember, Symbol interfaceMember, bool implementingTypeIsFromSomeCompilation) 2262protected MultiDictionary<Symbol, Symbol>.ValueSet GetExplicitImplementationForInterfaceMember(Symbol interfaceMember) 2278private MultiDictionary<Symbol, Symbol> MakeExplicitInterfaceImplementationMap() 2280var map = new MultiDictionary<Symbol, Symbol>(ExplicitInterfaceImplementationTargetMemberEqualityComparer.Instance); 2281foreach (var member in this.GetMembersUnordered()) 2283foreach (var interfaceMember in member.GetExplicitInterfaceImplementations()) 2349protected class ExplicitInterfaceImplementationTargetMemberEqualityComparer : IEqualityComparer<Symbol> 2354public bool Equals(Symbol x, Symbol y) 2360public int GetHashCode(Symbol obj) 2373internal ImmutableHashSet<Symbol> AbstractMembers 2385private ImmutableHashSet<Symbol> ComputeAbstractMembers() 2387var abstractMembers = ImmutableHashSet.Create<Symbol>(); 2388var overriddenMembers = ImmutableHashSet.Create<Symbol>(); 2390foreach (var member in this.GetMembersUnordered()) 2397Symbol overriddenMember = null; 2425foreach (var baseAbstractMember in this.BaseTypeNoUseSiteDiagnostics.AbstractMembers) 2466public static bool operator ==(Symbol left, TypeSymbol right) 2470public static bool operator !=(Symbol left, TypeSymbol right) 2474public static bool operator ==(TypeSymbol left, Symbol right) 2478public static bool operator !=(TypeSymbol left, Symbol right)
Symbols\TypeSymbol.SymbolAndDiagnostics.cs (2)
23public readonly Symbol Symbol; 26public SymbolAndDiagnostics(Symbol symbol, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics)
Symbols\TypeSymbolExtensions.cs (11)
19public Symbol? Symbol; 551private static bool IsNamespaceName(Symbol symbol, string[] names) 673public static bool IsAtLeastAsVisibleAs(this TypeSymbol type, Symbol sym, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 697private static bool IsTypeLessVisibleThan(TypeSymbol type, Symbol sym, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1001internal static bool IsAsRestrictive(this Symbol s1, Symbol sym2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1010for (Symbol s2 = sym2; s2.Kind != SymbolKind.Namespace; s2 = s2.ContainingSymbol) 1214private static readonly Func<TypeSymbol, Symbol, bool, bool> s_isTypeParameterWithSpecificContainerPredicate = 1740internal static TypeParameterSymbol? FindEnclosingTypeParameter(this Symbol methodOrType, string name) 1777var container = type.ContainingSymbol; 2086Symbol declaringSymbol,
Symbols\TypeWithAnnotations.cs (3)
424public bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 427Symbol.GetUnificationUseSiteDiagnosticRecursive(ref result, this.CustomModifiers, owner, ref checkedTypes); 430public bool IsAtLeastAsVisibleAs(Symbol sym, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Symbols\UpdatedContainingSymbolLocal.cs (5)
18internal static UpdatedContainingSymbolAndNullableAnnotationLocal CreateForTest(SourceLocalSymbol underlyingLocal, Symbol updatedContainingSymbol, TypeWithAnnotations updatedType) 23private UpdatedContainingSymbolAndNullableAnnotationLocal(SourceLocalSymbol underlyingLocal, Symbol updatedContainingSymbol, TypeWithAnnotations updatedType, bool assertContaining) 34internal UpdatedContainingSymbolAndNullableAnnotationLocal(SourceLocalSymbol underlyingLocal, Symbol updatedContainingSymbol, TypeWithAnnotations updatedType) 40public override Symbol ContainingSymbol { get; } 43public override bool Equals(Symbol other, TypeCompareKind compareKind)
Symbols\VarianceSafety.cs (11)
45foreach (Symbol member in interfaceType.GetMembersUnordered()) 96internal static NamedTypeSymbol GetEnclosingVariantInterface(Symbol member) 172private static bool SkipVarianceSafetyChecks(Symbol member) 236private static void CheckParametersVarianceSafety(ImmutableArray<ParameterSymbol> parameters, Symbol context, BindingDiagnosticBag diagnostics) 292Symbol context, 296where T : Symbol 360Symbol context, 364where T : Symbol 442Symbol context, 446where T : Symbol 483private static T GetDeclaringSyntax<T>(this Symbol symbol) where T : SyntaxNode
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenAsyncIteratorTests.cs (1)
6573var symbol = comp.GetWellKnownTypeMember(member);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (15)
Attributes\AttributeTests.cs (1)
3102var assembly = m.ContainingSymbol;
Attributes\AttributeTests_WellKnownAttributes.cs (3)
132var assembly = m.ContainingSymbol; 247var assembly = m.ContainingSymbol; 377var assembly = m.ContainingSymbol;
Attributes\WellKnownAttributesTestBase.cs (1)
73var assembly = m.ContainingSymbol;
RefReadonlyParameterTests.cs (1)
90var method = parameter.ContainingSymbol;
Semantics\PatternMatchingTests4.cs (9)
2075var ctorObject = compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctorObject); 2078var ctor = compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctor); 2081var invalidOperationExceptionCtor = compilation.GetWellKnownTypeMember(WellKnownMember.System_InvalidOperationException__ctor); 2214var ctorObject = compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctorObject); 2217var ctor = compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctor); 2417var ctorObject = compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctorObject); 2606var ctorObject = compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctorObject); 2609var ctor = compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctor); 2612var invalidOperationExceptionCtor = compilation.GetWellKnownTypeMember(WellKnownMember.System_InvalidOperationException__ctor);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\ExpressionBodiedMemberTests.cs (1)
210var prop = accessor.AssociatedSymbol;
Semantics\NullableReferenceTypesTests.cs (3)
115696var implicitOp = comp.GetSpecialTypeMember(SpecialMember.System_Nullable_T__op_Implicit_FromT); 115697var explicitOp = comp.GetSpecialTypeMember(SpecialMember.System_Nullable_T__op_Explicit_ToT); 115698var getDefault = comp.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_EqualityComparer_T__get_Default);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (33)
Symbols\InterfaceImplementationTests.cs (31)
142var implementingMethodBase = @class.FindImplementationForInterfaceMember(baseInterfaceMethod); 145var implementingMethod = @class.FindImplementationForInterfaceMember(interfaceMethod); 193var implementingMethodBase = @class.FindImplementationForInterfaceMember(baseInterfaceIndexer); 196var implementingMethod = @class.FindImplementationForInterfaceMember(interfaceIndexer); 262var implementingMethod = @class.FindImplementationForInterfaceMember(interfaceMethod); 265var implementingMethodBase1 = @class.FindImplementationForInterfaceMember(baseInterface1Method); 268var implementingMethodBase2 = @class.FindImplementationForInterfaceMember(baseInterface2Method); 330var implementingIndexer = @class.FindImplementationForInterfaceMember(interfaceIndexer); 333var implementingIndexerBase1 = @class.FindImplementationForInterfaceMember(baseInterface1Indexer); 336var implementingIndexerBase2 = @class.FindImplementationForInterfaceMember(baseInterface2Indexer); 453var class1ImplementingMethodBase = class1.FindImplementationForInterfaceMember(baseInterfaceMethod); 456var class1ImplementingMethod = class1.FindImplementationForInterfaceMember(interfaceMethod); 461var class2ImplementingMethodBase = class2.FindImplementationForInterfaceMember(baseInterfaceMethod); 464var class2ImplementingMethod = class2.FindImplementationForInterfaceMember(interfaceMethod); 526var class1ImplementingMethod = class1.FindImplementationForInterfaceMember(interfaceMethod); 529var class1ImplementingMethodBase1 = class1.FindImplementationForInterfaceMember(baseInterface1Method); 532var class1ImplementingMethodBase2 = class1.FindImplementationForInterfaceMember(baseInterface2Method); 537var class2ImplementingMethod = class2.FindImplementationForInterfaceMember(interfaceMethod); 540var class2ImplementingMethodBase1 = class2.FindImplementationForInterfaceMember(baseInterface1Method); 543var class2ImplementingMethodBase2 = class2.FindImplementationForInterfaceMember(baseInterface2Method); 683var baseClassImplementingMethod = baseClass.FindImplementationForInterfaceMember(interfaceMethod); 690var class1ImplementingMethod = class1.FindImplementationForInterfaceMember(interfaceMethod); 698var class2ImplementingMethod = class2.FindImplementationForInterfaceMember(interfaceMethod); 751var baseClassImplementingMethodVirtual = baseClass.FindImplementationForInterfaceMember(interfaceMethodVirtual); 754var baseClassImplementingMethodNonVirtual = baseClass.FindImplementationForInterfaceMember(interfaceMethodNonVirtual); 767var class1ImplementingMethodVirtual = class1.FindImplementationForInterfaceMember(interfaceMethodVirtual); 771var class1ImplementingMethodNonVirtual = class1.FindImplementationForInterfaceMember(interfaceMethodNonVirtual); 785var class2ImplementingMethodVirtual = class2.FindImplementationForInterfaceMember(interfaceMethodVirtual); 789var class2ImplementingMethodNonVirtual = class2.FindImplementationForInterfaceMember(interfaceMethodNonVirtual); 1073var classMethod1Impl = @class.FindImplementationForInterfaceMember(interfaceMethod1); 1077var classMethod2Impl = @class.FindImplementationForInterfaceMember(interfaceMethod2);
Symbols\MissingSpecialMember.cs (2)
556var symbol = comp.GetSpecialTypeMember(special); 1084var symbol = comp.GetWellKnownTypeMember(wkm);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
TestAttributesVisitor.cs (1)
99var containingSymbol = symbol.ContainingSymbol;