Seems something has changed in the processing for S4275 “recently” (between January 18th and this morning).
We have code that is loosely like:
Public Class A
Private _chargeId as Integer
Public Overrideable Property ChargeId As Integer
Get
Return _chargeId
End Get
Set(value As Integer)
If (value <> _chargeId)
_chargeId = value ' strictly speaking, we're doing other validation, but a scenario where auto properties aren't a solution
End If
End Set
End Propery
End Class
Public Class B
Inherits A
Public Overrides Property ChargeId As Integer
Get ' Refactor this getter so that it actually refers to the field '_chargeID'.
Return If(SomeCondition, MyBase.ChargeId, 1234)
End Get
Set(value As Integer) ' Refactor this setter so that it actually refers to the field '_chargeID'
MyBase.ChargeId = value
End Set
End Property
End Class
So we’re overriding a virtual method that doesn’t have access to _chargeId, yet the derived class class is told it should reference it.
As an aside, this also doesn’t show up in Visual Studio; but only when doing analysis on a build with Azure DevOps…