-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
Verify gets confused between the same generic and non-generic signature #749
Comments
@lepijohnny - Thank you for your report & analysis. This indeed looks like a bug, and your analysis of |
@stakx - I already have a fix for this it won't break any of the existing tests. I would be honored to contribute to this magnificent library so I would like to send PR with the fix (and tests of course). |
@lepijohnny - Please go ahead! Contributions are welcome! 👍 |
…e same signature
Fixed in #750. |
Hi,
A few days ago I came across this SO question. Although the question itself states something which is not correct I started investigating a bit and found one kinda strange thing which I want to share. Imagine this situation:
My actual question is why this test is passing, the method
Subcribe<T>()
is not the same asSubscribe()
?I also looked at the code and found potential bug within
InvocationShape.cs
class. During the matching of the invocation clearlyMethodInfo
of these methods are not equal so theIsOverride
has to be called.IsOverride
method will check if the verifying method is generic, in this case not as we are verifyingSubscribe
and it will fallback to parameter check which is in this case equal asSubcribe<T>
andSubcribe
do not have any parameters(in general it will be true if both method have the same set of parameters). IMO the check should be changed to if any of these methodsIsGenericMethod
, something like:The text was updated successfully, but these errors were encountered: