-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix incorrect comparison in MatchesTheFilter #112048
Conversation
Tagging subscribers to this area: @dotnet/area-system-reflection-emit |
This does look like an issue, but we should have a test. |
I do not think it is interesting to have tests for corner cases like this one. This typo is not coming back, and it is not really possible to create tests for all potential typos that the code may have. |
Isn't it good practice to have regression tests for fixes like this? And if easy to add tests covering the other branches on the path? |
Thank you for poking at the test coverage. It made me realize that the current logic has number of other corner-case holes. For example, it will match array types even if their rank differs. We should be able to do a simple type equality check instead, that is a lot simpler and that does not need extensive coverage assuming type equality is tested somewhere else. Superseded by #112464 |
Credit goes to https://pvs-studio.com/en/blog/posts/csharp/1216/