Base:
property
GetMethod
Microsoft.CodeAnalysis.CSharp.Symbols.PropertySymbol.GetMethod
69 references to GetMethod
Microsoft.CodeAnalysis.CSharp (22)
Binder\BinderFactory.BinderFactoryVisitor.cs (2)
292accessor = (parent.Kind() == SyntaxKind.GetAccessorDeclaration) ? propertySymbol.GetMethod : propertySymbol.SetMethod; 418var accessor = propertySymbol.GetMethod;
Symbols\Source\SourceMemberContainerSymbol.cs (6)
4148mergeAccessors(nonTypeMembers, (SourcePropertyAccessorSymbol?)currentProperty.GetMethod, (SourcePropertyAccessorSymbol?)prevProperty.GetMethod); 5173Debug.Assert(property.GetMethod is object); 5175members.Add(property.GetMethod); 5617AddAccessorIfAvailable(builder.NonTypeMembersWithPartialImplementations, property.GetMethod); 5742AddAccessorIfAvailable(builder.NonTypeMembersWithPartialImplementations, indexer.GetMethod);
Symbols\Source\SourcePropertyAccessorSymbol.cs (2)
820? (MethodKind == MethodKind.PropertyGet ? other.GetMethod : other.SetMethod) 824? (MethodKind == MethodKind.PropertyGet ? other.GetMethod : other.SetMethod)
Symbols\Source\SourcePropertySymbol.cs (2)
812if (this.GetMethod is { } definitionGetAccessor && implementation.GetMethod is { } implementationGetAccessor)
Symbols\Source\SourcePropertySymbolBase.cs (8)
757return GetMethod is null || HasAutoPropertyGet; 914if ((overriddenProperty.GetMethod is { } && GetMethod is null) || 934bool hasGetAccessor = GetMethod is object; 1013CheckExplicitImplementationAccessor(GetMethod, explicitlyImplementedProperty.GetMethod, explicitlyImplementedProperty, diagnostics); 1233bool hasGetter = GetMethod is object; 1256Debug.Assert(this.IsSealed && (GetMethod is null || SetMethod is null)); 1258if (GetMethod is object) 1896if (GetMethod is not null)
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (2)
168if (_property.GetMethod is not SourcePropertyAccessorSymbol getAccessor) 170Debug.Assert(_property.GetMethod is null);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
BreakingChanges.cs (2)
118Assert.Equal(Accessibility.Public, derivedProperty1.GetMethod.DeclaredAccessibility); 122Assert.Null(derivedProperty2.GetMethod);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (3)
Semantics\RecordTests.cs (3)
19028var equalityContractGet = equalityContract.GetMethod; 19144var equalityContractGet = equalityContract.GetMethod; 19217var equalityContractGet = equalityContract.GetMethod;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (42)
Symbols\PartialPropertiesTests.cs (12)
699Assert.True(prop.GetMethod!.GetPublicSymbol().IsExtern); 934Assert.Same(propDefinition.GetMethod, comp.GetMember<MethodSymbol>("C.get_P")); 937verifyAccessor(propDefinition.GetMethod!, propImplementation.GetMethod!); 1011var definitionAccessor = propDefinition.GetMethod!; 1094Assert.Null(propDefinition.GetMethod); 3930verify(indexer.GetMethod!.Parameters.Single()); 3992AssertEx.Equal(["Attr", "Attr"], property.GetMethod!.GetAttributes().ToStrings()); 4054AssertEx.Equal(["Attr", "Attr"], property.GetMethod!.GetAttributes().ToStrings()); 4055AssertEx.Equal(["Attr", "Attr"], property.GetMethod!.Parameters[0].GetAttributes().ToStrings()); 4056AssertEx.Equal(["Attr", "Attr"], property.GetMethod!.Parameters[1].GetAttributes().ToStrings()); 4335Assert.True(indexer.GetMethod!.Parameters[0].HasUnscopedRefAttribute); 4336Assert.True(indexer.GetMethod!.PartialImplementationPart!.Parameters[0].HasUnscopedRefAttribute);
Symbols\Source\ExpressionBodiedPropertyTests.cs (24)
261Assert.NotNull(p.GetMethod); 262Assert.False(p.GetMethod.IsImplicitlyDeclared); 267Assert.NotNull(indexer.GetMethod); 268Assert.False(indexer.GetMethod.IsImplicitlyDeclared); 508Assert.NotNull(p.GetMethod); 509Assert.False(p.GetMethod.IsImplicitlyDeclared); 511Assert.Equal(RefKind.Ref, p.GetMethod.RefKind); 531Assert.NotNull(p.GetMethod); 532Assert.False(p.GetMethod.IsImplicitlyDeclared); 534Assert.Equal(RefKind.RefReadOnly, p.GetMethod.RefKind); 536Assert.False(p.GetMethod.ReturnsByRef); 538Assert.True(p.GetMethod.ReturnsByRefReadonly); 558Assert.NotNull(p.GetMethod); 559Assert.False(p.GetMethod.IsImplicitlyDeclared); 561Assert.Equal(RefKind.RefReadOnly, p.GetMethod.RefKind); 562Assert.Equal(RefKind.In, p.GetMethod.Parameters[0].RefKind); 564Assert.False(p.GetMethod.ReturnsByRef); 566Assert.True(p.GetMethod.ReturnsByRefReadonly); 586Assert.NotNull(p.GetMethod); 587Assert.False(p.GetMethod.IsImplicitlyDeclared); 589Assert.Equal(RefKind.RefReadOnly, p.GetMethod.RefKind); 590Assert.Equal(RefKind.In, p.GetMethod.Parameters[0].RefKind); 592Assert.False(p.GetMethod.ReturnsByRef); 594Assert.True(p.GetMethod.ReturnsByRefReadonly);
Symbols\Source\RecordTests.cs (6)
152Assert.NotNull(x.GetMethod); 153Assert.Equal(MethodKind.PropertyGet, x.GetMethod!.MethodKind); 170var getAccessor = x.GetMethod; 186Assert.NotNull(y.GetMethod); 187Assert.Equal(MethodKind.PropertyGet, y.GetMethod!.MethodKind); 204getAccessor = y.GetMethod;