You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SonarLint does not recognise &= operator as assignment
S4275 fails the SET statement and suggests that _feedback parameter is not assigned a value in this line:
_feedback &= value
Repro steps
Friend Property Feedback As String
Get
Return _feedback
End Get
Private Set(value As String)
value = Trim(value).Trim()
Debug.Print(value)
If _feedback <> Nothing Then _feedback &= vbCrLf
_feedback &= value ' original Code
' _feedback = _feedback & value ' SonarLint compliant code
End Set
End Property
Private _feedback As String
Expected behavior
_feedback &= value ' original Code
should be acceptable
Actual behavior
_feedback &= value ' original Code
generates S4275 error
Known workarounds
_feedback = _feedback & value ' SonarLint compliant code
Related information
C#/VB.NET Plugins version ... 8.5.0.10497
Visual Studio version ... 17.11.5
MSBuild / dotnet version ... 4.8.09037
Using SonarLint & Sonar Cloud
Operating System ... Windows 10
The text was updated successfully, but these errors were encountered:
CristianAmbrosini
changed the title
Fix S4275 FP/FN: SonarLint does not recognise &= as assignment
Fix S4275 FP: Support &= assignment
Oct 30, 2024
Thanks Cristian,
We really appreciate the feedback. And your good work. Cheers Keith
From: Cristian ***@***.***>
Sent: Wed, 30 October 2024 12:17
To: SonarSource/sonar-dotnet ***@***.***>
Cc: Keith Shearer ***@***.***>; Mention ***@***.***>
Subject: Re: [SonarSource/sonar-dotnet] Fix S4275 FP: Support &= assignment (Issue #9688)
This message originates from outside the Badger Holdings Organization, please exercise caution
SonarLint does not recognise &= operator as assignment
S4275 fails the SET statement and suggests that _feedback parameter is not assigned a value in this line:
_feedback &= value
Repro steps
Expected behavior
_feedback &= value ' original Code
should be acceptable
Actual behavior
_feedback &= value ' original Code
generates S4275 error
Known workarounds
Related information
The text was updated successfully, but these errors were encountered: