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