JetBrains / JetBrains/resharper-unity

Rider - "Convert into auto-property with private setter" when a getter-only interface

Open
#2,479 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.2k
Forks
142
PR merge metrics
No merged PRs in 30d

Description

Resharper suggests to change a property with an explicit backing field to an auto-property even when that property is declared in an interface that specifies only the getter. Oviously, trying to make it automatically change the code to follow the suggestion, it generates an error:

![Image](https://github.com/user-attachments/assets/efea8cd8-4b21-4b6a-bcc7-72168ffedae7)

Gives

![Image](https://github.com/user-attachments/assets/63ba74e3-1d5f-4743-a115-d0acff3d4742)

Is this wanted? It seems confusing from a user standpoint

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.