Skip to content

Commit 11d4e3d

Browse files
Allow setters when checking for auto-properties
This is needed to support EnC for auto-props using the field keyword.
1 parent dbb1e92 commit 11d4e3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Features/Core/Portable/EditAndContinue/AbstractEditAndContinueAnalyzer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4217,8 +4217,8 @@ private void ReportUpdatedSymbolDeclarationRudeEdits(
42174217
else if (oldSymbol is IMethodSymbol oldMethod && newSymbol is IMethodSymbol newMethod)
42184218
{
42194219
// Changing property accessor to auto-property accessor adds a field:
4220-
if (oldMethod is { MethodKind: MethodKind.PropertyGet, AssociatedSymbol: IPropertySymbol oldProperty } && !oldProperty.IsAutoProperty() &&
4221-
newMethod is { MethodKind: MethodKind.PropertyGet, AssociatedSymbol: IPropertySymbol newProperty } && newProperty.IsAutoProperty() &&
4220+
if (oldMethod is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: IPropertySymbol oldProperty } && !oldProperty.IsAutoProperty() &&
4221+
newMethod is { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: IPropertySymbol newProperty } && newProperty.IsAutoProperty() &&
42224222
!capabilities.Grant(GetRequiredAddFieldCapabilities(newMethod)))
42234223
{
42244224
rudeEdit = RudeEditKind.InsertNotSupportedByRuntime;

0 commit comments

Comments
 (0)