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
Product and Version Used:
Roslynator 2019 2.9.0 extension
Steps to Reproduce:
with nullable enabled in a c#8.0 project
if(connectedSystem.Credentials.Account=="")
connectedSystem is not nullable
connectedSystem.Credentials is not nullable
connectedSystem.Credentials.Account is string?
Actual Behavior:
The message below is suggested
Message RCS1113 Use 'string.IsNullOrEmpty' method
Expected Behavior:
No suggestion to be made as the intention is to check that connectedSystem.Credentials.Account is not null but is empty. The same suggestion is made when string.Empty is used instead of "".
On looking at the documentation page, the second diagnostic message shows the same behaviour which also appears incorrect.
I can see this was probably introduced as #650 which incorrectly assumes the intention of whether the original string being null is different to it being empty.
The text was updated successfully, but these errors were encountered:
Product and Version Used:
Roslynator 2019 2.9.0 extension
Steps to Reproduce:
with nullable enabled in a c#8.0 project
connectedSystem is not nullable
connectedSystem.Credentials is not nullable
connectedSystem.Credentials.Account is string?
Actual Behavior:
The message below is suggested
Message RCS1113 Use 'string.IsNullOrEmpty' method
Expected Behavior:
No suggestion to be made as the intention is to check that connectedSystem.Credentials.Account is not null but is empty. The same suggestion is made when string.Empty is used instead of "".
On looking at the documentation page, the second diagnostic message shows the same behaviour which also appears incorrect.
https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1113.md
I can see this was probably introduced as #650 which incorrectly assumes the intention of whether the original string being null is different to it being empty.
The text was updated successfully, but these errors were encountered: