-
Notifications
You must be signed in to change notification settings - Fork 35
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
NUnit1032
throws an exception in a specific configuration
#659
Comments
NUnit1032
fails in a specific configurationNUnit1032
throws an exception in a specific configuration
Thanks @RenderMichael for your report. The problem here is that your field and property have the same name and the analyzer doesn't expect this. The optimization changes I did in #658 do fix your particular use-case as part of that change, read-only properties are not added to that dictionary as you cannot assign them, there is no need to check for them.
Removing What also fixes it is:
|
Since it’s an explicit implementation, you couldn’t use the property without a cast to the interface. That’s the reason I have it this way: It makes the property invisible to inheritors of the class while retaining Is it possible to exclude explicit implementations from the analysis? That’s the only way I know of to get members/fields with the same name. |
I added a PR to exclude explicit implementations. |
The following code fails:
This gives the following error:
If you remove
abstract
, or the attribute on the getter of the explicit implementation ofIDataProvider.DataReader
onTest
, or the[OneTimeSetUp]
attribute, this starts to work.The text was updated successfully, but these errors were encountered: