Binder\Binder.ValueChecks.cs (17)
68internal static MethodInfo Create(PropertySymbol property)
76internal static MethodInfo Create(PropertySymbol property, AccessorKind accessorKind) =>
1715var propertySymbol = GetPropertySymbol(expr, out receiver, out propertySyntax);
2604case PropertySymbol property:
3568var indexerSymbol = indexerAccess.Indexer;
3590var indexerSymbol = indexerAccess.Indexer;
3867var indexerSymbol = indexerAccess.Indexer;
3898var indexerSymbol = indexerAccess.Indexer;
4009var propertySymbol = propertyAccess.PropertySymbol;
4269var indexerSymbol = indexerAccess.Indexer;
4291var indexerSymbol = indexerAccess.Indexer;
4709PropertySymbol { IsIndexer: true } indexer => getIndexerEscape(indexer, left, rightEscape),
4710PropertySymbol property => getPropertyEscape(property, rightEscape),
4727PropertySymbol indexer,
4780PropertySymbol property,
4994var indexerSymbol = indexerAccess.Indexer;
5020var indexerSymbol = indexerAccess.Indexer;
Binder\Binder_Expressions.cs (42)
1513ContainingMember() is MethodSymbol { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: PropertySymbol { IsIndexer: false } })
2213return BindPropertyAccess(node, receiver, (PropertySymbol)symbol, diagnostics, resultKind, hasErrors: isError);
6040PropertySymbol propertySymbol,
8037case PropertySymbol propertySymbol:
8330resultType = ((PropertySymbol)symbolOpt).Type;
8474result = BindPropertyAccess(node, left, (PropertySymbol)symbol, diagnostics, lookupResult.Kind, hasErrors: wasError);
8633OverloadResolutionResult<PropertySymbol>? propertyResult = arity != 0 || acceptOnlyMethods ? null : resolveProperties(left, lookupResult, binder, ref actualReceiverArguments, ref useSiteInfo);
8780static OverloadResolutionResult<PropertySymbol>? resolveProperties(
8787ArrayBuilder<PropertySymbol>? properties = null;
8790if (member is PropertySymbol property)
8792properties ??= ArrayBuilder<PropertySymbol>.GetInstance();
8808OverloadResolutionResult<PropertySymbol> overloadResolutionResult = OverloadResolutionResult<PropertySymbol>.GetInstance();
9052PropertySymbol propertySymbol,
9331foreach (PropertySymbol property in members)
9667return BindDynamicIndexer(node, expr, arguments, ImmutableArray<PropertySymbol>.Empty, diagnostics);
9991ArrayBuilder<PropertySymbol> indexerGroup = ArrayBuilder<PropertySymbol>.GetInstance();
9995indexerGroup.Add((PropertySymbol)symbol);
10006private static readonly Func<PropertySymbol, bool> s_isIndexedPropertyWithNonOptionalArguments = property =>
10057private BoundExpression BindIndexedPropertyAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<PropertySymbol> propertyGroup, AnalyzedArguments arguments, BindingDiagnosticBag diagnostics)
10062var properties = ArrayBuilder<PropertySymbol>.GetInstance();
10074ImmutableArray<PropertySymbol> applicableProperties,
10117ArrayBuilder<PropertySymbol> propertyGroup,
10122OverloadResolutionResult<PropertySymbol> overloadResolutionResult = OverloadResolutionResult<PropertySymbol>.GetInstance();
10157ArrayBuilder<PropertySymbol> propertyGroup,
10159OverloadResolutionResult<PropertySymbol> overloadResolutionResult,
10170ImmutableArray<PropertySymbol> candidates = propertyGroup.ToImmutable();
10184var candidate = candidates[0];
10205PropertySymbol property = (candidates.Length == 1) ? candidates[0] : CreateErrorPropertySymbol(candidates);
10218MemberResolutionResult<PropertySymbol> resolutionResult = overloadResolutionResult.ValidResult;
10219PropertySymbol property = resolutionResult.Member;
10229this.CheckAndCoerceArguments<PropertySymbol>(syntax, resolutionResult, analyzedArguments, diagnostics, receiver, invokedAsExtensionMethod: false, out argsToParams);
10412candidate is PropertySymbol property &&
10422var properties = ArrayBuilder<PropertySymbol>.GetInstance();
10528if (TryLookupLengthOrCount(syntax, receiverPlaceholder.Type, lookupResult, out var lengthOrCountProperty, diagnostics))
10548[NotNullWhen(true)] out PropertySymbol? lengthOrCountProperty,
10560bool tryLookupLengthOrCount(SyntaxNode syntax, string propertyName, [NotNullWhen(true)] out PropertySymbol? valid, BindingDiagnosticBag diagnostics)
10576lookupResult.Symbols[0] is PropertySymbol property &&
10595private ErrorPropertySymbol CreateErrorPropertySymbol(ImmutableArray<PropertySymbol> propertyGroup)
10598var candidate = propertyGroup[0];
FlowAnalysis\NullableWalker.cs (30)
660predicate: member => member is PropertySymbol { IsRequired: true },
663var property = (PropertySymbol)member;
738symbol = (Symbol?)(f.AssociatedSymbol as PropertySymbol) ?? f;
749case PropertySymbol p when forcePropertyAnalysis:
820case PropertySymbol { IsRequired: true }:
822case PropertySymbol:
935var prop = symbolToInitialize as PropertySymbol ?? (symbolToInitialize as FieldSymbol)?.AssociatedSymbol as PropertySymbol;
972if (requiredMember is PropertySymbol { IsAbstract: true } abstractProperty)
975&& isFilterableOverrideOfAbstractProperty((PropertySymbol)overridingMember))
997var property = (PropertySymbol)requiredMember;
1022static bool isFilterableOverrideOfAbstractProperty(PropertySymbol property)
2061var propSymbol = propAccess.PropertySymbol;
2771if (method is SourcePropertyAccessorSymbol { AssociatedSymbol: PropertySymbol prop } && (object)backingField.AssociatedSymbol == prop)
4268((PropertySymbol?)symbol)?.Parameters ?? default, objectInitializer.ArgsToParamsOpt,
4327argumentsCompletion?.Invoke(argumentResults, ((PropertySymbol?)symbol)?.Parameters ?? default, null);
4651var property = AnonymousTypeManager.GetAnonymousTypeProperty(anonymousType, i);
4672static BoundAnonymousPropertyDeclaration? getDeclaration(BoundAnonymousObjectCreationExpression node, PropertySymbol currentProperty, ref int currentDeclarationIndex)
5626if ((member is PropertySymbol { IsIndexedProperty: false } || member.Kind == SymbolKind.Field) &&
6886PropertySymbol? property,
10168private bool IsPropertyOutputMoreStrictThanInput(PropertySymbol property)
10189var property = left switch
10242var annotations = memberSymbol switch { PropertySymbol prop => prop.GetFlowAnalysisAnnotations(), FieldSymbol field => GetFieldAnnotations(field), _ => FlowAnalysisAnnotations.None };
10847var property = node.PropertySymbol;
10874var indexer = node.Indexer;
10878indexer = (PropertySymbol)AsMemberOfType(receiverType, indexer);
10988var getMethod = ((PropertySymbol)member.OriginalDefinition).GetMethod;
Generated\BoundNodes.xml.Generated.cs (54)
339public BoundPropertyEqualsValue(SyntaxNode syntax, PropertySymbol property, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false)
350public PropertySymbol Property { get; }
355public BoundPropertyEqualsValue Update(PropertySymbol property, ImmutableArray<LocalSymbol> locals, BoundExpression value)
2141public BoundAwaitableInfo(SyntaxNode syntax, BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult, bool hasErrors = false)
2154public PropertySymbol? IsCompleted { get; }
2160public BoundAwaitableInfo Update(BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult)
5470public BoundDagPropertyEvaluation(SyntaxNode syntax, PropertySymbol property, bool isLengthOrCount, BoundDagTemp input, bool hasErrors = false)
5481public PropertySymbol Property { get; }
5487public BoundDagPropertyEvaluation Update(PropertySymbol property, bool isLengthOrCount, BoundDagTemp input)
5501public BoundDagIndexEvaluation(SyntaxNode syntax, PropertySymbol property, int index, BoundDagTemp input, bool hasErrors = false)
5512public PropertySymbol Property { get; }
5518public BoundDagIndexEvaluation Update(PropertySymbol property, int index, BoundDagTemp input)
6114public BoundPropertyGroup(SyntaxNode syntax, ImmutableArray<PropertySymbol> properties, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false)
6123public ImmutableArray<PropertySymbol> Properties { get; }
6128public BoundPropertyGroup Update(ImmutableArray<PropertySymbol> properties, BoundExpression? receiverOpt, LookupResultKind resultKind)
7012public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type, bool hasErrors)
7022public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type)
7033public PropertySymbol Property { get; }
7038public BoundAnonymousPropertyDeclaration Update(PropertySymbol property, TypeSymbol type)
7336public BoundPropertyAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
7353public PropertySymbol PropertySymbol { get; }
7360public BoundPropertyAccess Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type)
7410public BoundIndexerAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol indexer, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, AccessorKind accessorKind, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ImmutableArray<PropertySymbol> originalIndexersOpt, TypeSymbol type, bool hasErrors = false)
7434public PropertySymbol Indexer { get; }
7442public ImmutableArray<PropertySymbol> OriginalIndexersOpt { get; }
7447public BoundIndexerAccess Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol indexer, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, AccessorKind accessorKind, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ImmutableArray<PropertySymbol> originalIndexersOpt, TypeSymbol type)
7551public BoundDynamicIndexerAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<PropertySymbol> applicableIndexers, TypeSymbol type, bool hasErrors = false)
7572public ImmutableArray<PropertySymbol> ApplicableIndexers { get; }
7577public BoundDynamicIndexerAccess Update(BoundExpression receiver, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<PropertySymbol> applicableIndexers, TypeSymbol type)
10843PropertySymbol property = this.VisitPropertySymbol(node.Property);
11176PropertySymbol? isCompleted = this.VisitPropertySymbol(node.IsCompleted);
11749PropertySymbol property = this.VisitPropertySymbol(node.Property);
11755PropertySymbol property = this.VisitPropertySymbol(node.Property);
11874ImmutableArray<PropertySymbol> properties = this.VisitSymbols<PropertySymbol>(node.Properties);
12038PropertySymbol property = this.VisitPropertySymbol(node.Property);
12099PropertySymbol propertySymbol = this.VisitPropertySymbol(node.PropertySymbol);
12113PropertySymbol indexer = this.VisitPropertySymbol(node.Indexer);
12114ImmutableArray<PropertySymbol> originalIndexersOpt = this.VisitSymbols<PropertySymbol>(node.OriginalIndexersOpt);
12140ImmutableArray<PropertySymbol> applicableIndexers = this.VisitSymbols<PropertySymbol>(node.ApplicableIndexers);
12419PropertySymbol property = GetUpdatedSymbol(node, node.Property);
13134PropertySymbol? isCompleted = GetUpdatedSymbol(node, node.IsCompleted);
13869PropertySymbol property = GetUpdatedSymbol(node, node.Property);
13876PropertySymbol property = GetUpdatedSymbol(node, node.Property);
14092ImmutableArray<PropertySymbol> properties = GetUpdatedArray(node, node.Properties);
14469PropertySymbol property = GetUpdatedSymbol(node, node.Property);
14629PropertySymbol propertySymbol = GetUpdatedSymbol(node, node.PropertySymbol);
14665PropertySymbol indexer = GetUpdatedSymbol(node, node.Indexer);
14666ImmutableArray<PropertySymbol> originalIndexersOpt = GetUpdatedArray(node, node.OriginalIndexersOpt);
14703ImmutableArray<PropertySymbol> applicableIndexers = GetUpdatedArray(node, node.ApplicableIndexers);
Symbols\Compilation_WellKnownMembers.cs (8)
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)
330PropertySymbol property = (PropertySymbol)member;
1061internal class SpecialMembersSignatureComparer : SignatureComparer<MethodSymbol, FieldSymbol, PropertySymbol, TypeSymbol, ParameterSymbol>
1090protected override TypeSymbol GetPropertyType(PropertySymbol property)
1136protected override ImmutableArray<ParameterSymbol> GetParameters(PropertySymbol property)
1180protected override bool IsByRefProperty(PropertySymbol property)
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (16)
326(PropertySymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_ICollection__Count)!,
331(PropertySymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_ICollection__IsSynchronized)!,
336(PropertySymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_ICollection__SyncRoot)!,
346(PropertySymbol)((MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_IList__get_Item)!).AssociatedSymbol,
352(PropertySymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_IList__IsFixedSize)!,
357(PropertySymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_IList__IsReadOnly)!,
404((PropertySymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_IReadOnlyCollection_T__Count)!).AsMember(iReadOnlyCollectionT),
409((PropertySymbol)((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_IReadOnlyList_T__get_Item)!).AssociatedSymbol).AsMember(iReadOnlyListT),
415((PropertySymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_ICollection_T__Count)!).AsMember(iCollectionT),
420((PropertySymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_ICollection_T__IsReadOnly)!).AsMember(iCollectionT),
450((PropertySymbol)((MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Collections_Generic_IList_T__get_Item)!).AssociatedSymbol).AsMember(iListT),
517var listMember = (PropertySymbol)containingType.GetFieldTypeMember(WellKnownMember.System_Collections_Generic_List_T__Count);
675var listMember = (PropertySymbol)((MethodSymbol)containingType.GetFieldTypeMember(WellKnownMember.System_Collections_Generic_List_T__get_Item)).AssociatedSymbol;
728static void addProperty(ArrayBuilder<Symbol> builder, PropertySymbol property)