-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SA1101: "Prefix calls with this" incorrectly handles properties as expression bodies #1501
Comments
Weird 🐛 catch! |
Im currently looking into this and I have trouble reproducing this. Is the code you posted exactly the one that was reporting SA1101? Which version were you using? |
Howdy, It's using the latest pre-release from nuget. Take a look at the example solution here: |
Wow thats weird! It shows up for me in the msbuild output as well but not the error list. |
We've experienced some errors not getting into the error list before, always thought it was a VS bug - as we have quite a large solution and VS isn't always good at updating the error list and as I understand it adding the diagnostic is all you need to do and VS should update the relevant UX... |
I am able to repro this in the debugger and I think that the bug is not our fault. Roslyns |
Cool, odd that it would behave differently just because of the initiating process (MSBuild vs IDE). Will be interesting to see what the outcome is from it! |
I filed the bug report. Maybe it was some last minute bug fixing in the version that shipped in VS. (or there was a bug report that introduced this bug that didnt made it into VS) |
I created a PR that works around this issue for now. |
When using expression bodies for properties the diagnostic for SA1101 is incorrectly detected when the property name is the same as a type/enum, i.e.
It is not detected if this is a declared getter:
The text was updated successfully, but these errors were encountered: