Base:
property
SetMethod
Microsoft.CodeAnalysis.CSharp.Symbols.PropertySymbol.SetMethod
48 references to SetMethod
Microsoft.CodeAnalysis.CSharp (23)
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
292
accessor = (parent.Kind() == SyntaxKind.GetAccessorDeclaration) ? propertySymbol.GetMethod : propertySymbol.
SetMethod
;
FlowAnalysis\NullableWalker.cs (1)
10454
if (left is BoundPropertyAccess { PropertySymbol: SourcePropertySymbolBase {
SetMethod
: null, UsesFieldKeyword: true } property })
Symbols\Source\SourceMemberContainerSymbol.cs (6)
4177
mergeAccessors(nonTypeMembers, (SourcePropertyAccessorSymbol?)currentProperty.
SetMethod
, (SourcePropertyAccessorSymbol?)prevProperty.
SetMethod
);
5202
Debug.Assert(property.
SetMethod
is object);
5204
members.Add(property.
SetMethod
);
5646
AddAccessorIfAvailable(builder.NonTypeMembersWithPartialImplementations, property.
SetMethod
);
5771
AddAccessorIfAvailable(builder.NonTypeMembersWithPartialImplementations, indexer.
SetMethod
);
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 (4)
689
else if (
SetMethod
is object && param.Name == ParameterSymbol.ValueParameterName)
695
if (
SetMethod
is { } setter && this.GetIsNewExtensionMember())
817
if (this.
SetMethod
is { } definitionSetAccessor && implementation.
SetMethod
is { } implementationSetAccessor)
Symbols\Source\SourcePropertySymbolBase.cs (9)
753
return
SetMethod
is null || HasAutoPropertySet;
889
if (!IsStatic && ((_propertyFlags & Flags.HasAutoPropertySet) != 0) &&
SetMethod
is { IsInitOnly: false })
915
(overriddenProperty.SetMethod is { } &&
SetMethod
is null))
935
bool hasSetAccessor =
SetMethod
is object;
1014
CheckExplicitImplementationAccessor(
SetMethod
, explicitlyImplementedProperty.SetMethod, explicitlyImplementedProperty, diagnostics);
1232
bool hasSetter =
SetMethod
is object;
1254
Debug.Assert(this.IsSealed && (GetMethod is null ||
SetMethod
is null));
1262
else if (
SetMethod
is object)
1893
else if (
SetMethod
is not null)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
BreakingChanges.cs (2)
119
Assert.Null(derivedProperty1.
SetMethod
);
123
Assert.Equal(Accessibility.Public, derivedProperty2.
SetMethod
.DeclaredAccessibility);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\InitOnlyMemberTests.cs (3)
4769
var modifier = ((SourcePropertySymbol)comp.GlobalNamespace.GetMember("C.Property")).
SetMethod
.ReturnTypeWithAnnotations.CustomModifiers.Single();
4822
var modifier = ((SourcePropertySymbol)comp.GlobalNamespace.GetMember("C.Property")).
SetMethod
.ReturnTypeWithAnnotations.CustomModifiers.Single();
4834
var modifier = ((SourcePropertySymbol)comp.GlobalNamespace.GetMember("C.Property")).
SetMethod
.ReturnTypeWithAnnotations.CustomModifiers.Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (20)
Symbols\PartialPropertiesTests.cs (12)
700
Assert.True(prop.
SetMethod
!.GetPublicSymbol().IsExtern);
935
Assert.Same(propDefinition.
SetMethod
, comp.GetMember<MethodSymbol>("C.set_P"));
938
verifyAccessor(propDefinition.
SetMethod
!, propImplementation.SetMethod!);
1008
Assert.Null(propDefinition.
SetMethod
);
1097
var definitionAccessor = propDefinition.
SetMethod
!;
3931
verify(indexer.
SetMethod
!.Parameters[0]);
3993
AssertEx.Equal(["Attr", "Attr"], property.
SetMethod
!.GetAttributes().ToStrings());
3994
AssertEx.Equal(["Attr", "Attr"], property.
SetMethod
!.Parameters.Single().GetAttributes().ToStrings());
4057
AssertEx.Equal(["Attr", "Attr"], property.
SetMethod
!.GetAttributes().ToStrings());
4058
AssertEx.Equal(["Attr", "Attr"], property.
SetMethod
!.Parameters[0].GetAttributes().ToStrings());
4059
AssertEx.Equal(["Attr", "Attr"], property.
SetMethod
!.Parameters[1].GetAttributes().ToStrings());
4060
AssertEx.Equal(["Attr", "Attr"], property.
SetMethod
!.Parameters[2].GetAttributes().ToStrings());
Symbols\Source\ExpressionBodiedPropertyTests.cs (6)
260
Assert.Null(p.
SetMethod
);
266
Assert.Null(indexer.
SetMethod
);
507
Assert.Null(p.
SetMethod
);
530
Assert.Null(p.
SetMethod
);
557
Assert.Null(p.
SetMethod
);
585
Assert.Null(p.
SetMethod
);
Symbols\Source\RecordTests.cs (2)
177
var setAccessor = x.
SetMethod
;
210
setAccessor = y.
SetMethod
;