Binder\Binder.ValueChecks.cs (17)
68internal static MethodInfo Create(PropertySymbol property)
76internal static MethodInfo Create(PropertySymbol property, AccessorKind accessorKind) =>
1708var propertySymbol = GetPropertySymbol(expr, out receiver, out propertySyntax);
2535case PropertySymbol property:
3488var indexerSymbol = indexerAccess.Indexer;
3510var indexerSymbol = indexerAccess.Indexer;
3787var indexerSymbol = indexerAccess.Indexer;
3818var indexerSymbol = indexerAccess.Indexer;
3929var propertySymbol = propertyAccess.PropertySymbol;
4190var indexerSymbol = indexerAccess.Indexer;
4212var indexerSymbol = indexerAccess.Indexer;
4629PropertySymbol { IsIndexer: true } indexer => getIndexerEscape(indexer, left, rightEscape),
4630PropertySymbol property => getPropertyEscape(property, rightEscape),
4642PropertySymbol indexer,
4695PropertySymbol property,
4909var indexerSymbol = indexerAccess.Indexer;
4935var indexerSymbol = indexerAccess.Indexer;
Binder\Binder_Expressions.cs (33)
2165return BindPropertyAccess(node, receiver, (PropertySymbol)symbol, diagnostics, resultKind, hasErrors: isError);
5986PropertySymbol propertySymbol,
8175resultType = ((PropertySymbol)symbolOpt).Type;
8308result = BindPropertyAccess(node, left, (PropertySymbol)symbol, diagnostics, lookupResult.Kind, hasErrors: wasError);
8673PropertySymbol propertySymbol,
8952foreach (PropertySymbol property in members)
9288return BindDynamicIndexer(node, expr, arguments, ImmutableArray<PropertySymbol>.Empty, diagnostics);
9612ArrayBuilder<PropertySymbol> indexerGroup = ArrayBuilder<PropertySymbol>.GetInstance();
9616indexerGroup.Add((PropertySymbol)symbol);
9627private static readonly Func<PropertySymbol, bool> s_isIndexedPropertyWithNonOptionalArguments = property =>
9678private BoundExpression BindIndexedPropertyAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<PropertySymbol> propertyGroup, AnalyzedArguments arguments, BindingDiagnosticBag diagnostics)
9683var properties = ArrayBuilder<PropertySymbol>.GetInstance();
9695ImmutableArray<PropertySymbol> applicableProperties,
9738ArrayBuilder<PropertySymbol> propertyGroup,
9743OverloadResolutionResult<PropertySymbol> overloadResolutionResult = OverloadResolutionResult<PropertySymbol>.GetInstance();
9778ArrayBuilder<PropertySymbol> propertyGroup,
9780OverloadResolutionResult<PropertySymbol> overloadResolutionResult,
9791ImmutableArray<PropertySymbol> candidates = propertyGroup.ToImmutable();
9805var candidate = candidates[0];
9826PropertySymbol property = (candidates.Length == 1) ? candidates[0] : CreateErrorPropertySymbol(candidates);
9839MemberResolutionResult<PropertySymbol> resolutionResult = overloadResolutionResult.ValidResult;
9840PropertySymbol property = resolutionResult.Member;
9850this.CheckAndCoerceArguments<PropertySymbol>(syntax, resolutionResult, analyzedArguments, diagnostics, receiver, invokedAsExtensionMethod: false, out argsToParams);
10033candidate is PropertySymbol property &&
10043var properties = ArrayBuilder<PropertySymbol>.GetInstance();
10147if (TryLookupLengthOrCount(syntax, receiverPlaceholder.Type, lookupResult, out var lengthOrCountProperty, diagnostics))
10167[NotNullWhen(true)] out PropertySymbol? lengthOrCountProperty,
10179bool tryLookupLengthOrCount(SyntaxNode syntax, string propertyName, [NotNullWhen(true)] out PropertySymbol? valid, BindingDiagnosticBag diagnostics)
10195lookupResult.Symbols[0] is PropertySymbol property &&
10214private ErrorPropertySymbol CreateErrorPropertySymbol(ImmutableArray<PropertySymbol> propertyGroup)
10217var candidate = propertyGroup[0];
FlowAnalysis\NullableWalker.cs (23)
650predicate: member => member is PropertySymbol { IsRequired: true },
653var property = (PropertySymbol)member;
728symbol = (Symbol?)(f.AssociatedSymbol as PropertySymbol) ?? f;
739case PropertySymbol p when forcePropertyAnalysis:
810case PropertySymbol { IsRequired: true }:
812case PropertySymbol:
959var property = (PropertySymbol)requiredMember;
1978var propSymbol = propAccess.PropertySymbol;
4123((PropertySymbol?)symbol)?.Parameters ?? default, objectInitializer.ArgsToParamsOpt,
4182argumentsCompletion?.Invoke(argumentResults, ((PropertySymbol?)symbol)?.Parameters ?? default, null);
4505var property = AnonymousTypeManager.GetAnonymousTypeProperty(anonymousType, i);
4526static BoundAnonymousPropertyDeclaration? getDeclaration(BoundAnonymousObjectCreationExpression node, PropertySymbol currentProperty, ref int currentDeclarationIndex)
5479if ((member is PropertySymbol { IsIndexedProperty: false } || member.Kind == SymbolKind.Field) &&
6731PropertySymbol? property,
9991private bool IsPropertyOutputMoreStrictThanInput(PropertySymbol property)
10012var property = left switch
10065var annotations = memberSymbol switch { PropertySymbol prop => prop.GetFlowAnalysisAnnotations(), FieldSymbol field => GetFieldAnnotations(field), _ => FlowAnalysisAnnotations.None };
10669var property = node.PropertySymbol;
10696var indexer = node.Indexer;
10700indexer = (PropertySymbol)AsMemberOfType(receiverType, indexer);
10810var getMethod = ((PropertySymbol)member.OriginalDefinition).GetMethod;
Generated\BoundNodes.xml.Generated.cs (41)
338public BoundPropertyEqualsValue(SyntaxNode syntax, PropertySymbol property, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false)
349public PropertySymbol Property { get; }
354public BoundPropertyEqualsValue Update(PropertySymbol property, ImmutableArray<LocalSymbol> locals, BoundExpression value)
2140public BoundAwaitableInfo(SyntaxNode syntax, BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult, bool hasErrors = false)
2153public PropertySymbol? IsCompleted { get; }
2159public BoundAwaitableInfo Update(BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult)
5471public BoundDagPropertyEvaluation(SyntaxNode syntax, PropertySymbol property, bool isLengthOrCount, BoundDagTemp input, bool hasErrors = false)
5482public PropertySymbol Property { get; }
5488public BoundDagPropertyEvaluation Update(PropertySymbol property, bool isLengthOrCount, BoundDagTemp input)
5502public BoundDagIndexEvaluation(SyntaxNode syntax, PropertySymbol property, int index, BoundDagTemp input, bool hasErrors = false)
5513public PropertySymbol Property { get; }
5519public BoundDagIndexEvaluation Update(PropertySymbol property, int index, BoundDagTemp input)
6115public BoundPropertyGroup(SyntaxNode syntax, ImmutableArray<PropertySymbol> properties, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false)
6124public ImmutableArray<PropertySymbol> Properties { get; }
6129public BoundPropertyGroup Update(ImmutableArray<PropertySymbol> properties, BoundExpression? receiverOpt, LookupResultKind resultKind)
7013public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type, bool hasErrors)
7023public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type)
7034public PropertySymbol Property { get; }
7039public BoundAnonymousPropertyDeclaration Update(PropertySymbol property, TypeSymbol type)
7337public BoundPropertyAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
7354public PropertySymbol PropertySymbol { get; }
7361public BoundPropertyAccess Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type)
7411public 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)
7435public PropertySymbol Indexer { get; }
7443public ImmutableArray<PropertySymbol> OriginalIndexersOpt { get; }
7448public 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)
7552public BoundDynamicIndexerAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<PropertySymbol> applicableIndexers, TypeSymbol type, bool hasErrors = false)
7573public ImmutableArray<PropertySymbol> ApplicableIndexers { get; }
7578public BoundDynamicIndexerAccess Update(BoundExpression receiver, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<PropertySymbol> applicableIndexers, TypeSymbol type)
12238PropertySymbol property = GetUpdatedSymbol(node, node.Property);
12953PropertySymbol? isCompleted = GetUpdatedSymbol(node, node.IsCompleted);
13689PropertySymbol property = GetUpdatedSymbol(node, node.Property);
13696PropertySymbol property = GetUpdatedSymbol(node, node.Property);
13912ImmutableArray<PropertySymbol> properties = GetUpdatedArray(node, node.Properties);
14289PropertySymbol property = GetUpdatedSymbol(node, node.Property);
14449PropertySymbol propertySymbol = GetUpdatedSymbol(node, node.PropertySymbol);
14485PropertySymbol indexer = GetUpdatedSymbol(node, node.Indexer);
14486ImmutableArray<PropertySymbol> originalIndexersOpt = GetUpdatedArray(node, node.OriginalIndexersOpt);
14523ImmutableArray<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\Source\SourceMemberContainerSymbol.cs (24)
2188var indexersBySignature = new Dictionary<PropertySymbol, PropertySymbol>(MemberSignatureComparer.DuplicateSourceComparer);
2200PropertySymbol indexer = (PropertySymbol)symbol;
2227PropertySymbol indexer,
2230Dictionary<PropertySymbol, PropertySymbol> indexersBySignature,
2264if (indexersBySignature.TryGetValue(indexer, out var prevIndexerBySignature))
2324var propertySymbol = (PropertySymbol)symbol;
3833PropertySymbol propertySymbol,
3915private static Location GetAccessorOrPropertyLocation(PropertySymbol propertySymbol, bool getNotSet)
3934private static bool ParametersMatchPropertyAccessor(PropertySymbol propertySymbol, bool getNotSet, ImmutableArray<ParameterSymbol> methodParams)
4245PropertySymbol? equalityContract = isRecordClass ? addEqualityContract() : null;
4271Debug.Assert(isRecordClass || !members.Any(m => m is PropertySymbol { GetMethod.IsEffectivelyReadOnly: false }));
4282Debug.Assert(positionalMembers.All(p => p is PropertySymbol or FieldSymbol));
4530ImmutableArray<PropertySymbol>.Empty);
4554else if (existingMember is PropertySymbol { IsStatic: false, GetMethod: { } } prop
4612MethodSymbol addGetHashCode(PropertySymbol? equalityContract)
4646PropertySymbol addEqualityContract()
4656ImmutableArray<PropertySymbol>.Empty);
4658PropertySymbol equalityContract;
4668equalityContract = (PropertySymbol)existingEqualityContractProperty;
4705MethodSymbol addThisEquals(PropertySymbol? equalityContract)
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)