Skip to content

Fix MethodSignatureComparer to handle nested generics#303

Merged
jonorossi merged 3 commits intocastleproject:masterfrom
BitWizJason:master
Sep 21, 2017
Merged

Fix MethodSignatureComparer to handle nested generics#303
jonorossi merged 3 commits intocastleproject:masterfrom
BitWizJason:master

Conversation

@BitWizJason
Copy link

I added test cases that demonstrate the issue in the first commit and a potential fix in the second commit.

…generic as a return type are inherited and overriden. This is in reference to issue castleproject#297
…ds with the base method when they contain a nested generic as the return type. References issue castleproject#297
return false;
}
}
else if (x.GetGenericArguments().Length > 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this use x.IsGenericType instead?


for (var i = 0; i < xArgs.Length; ++i)
{
if (xArgs[i].GetTypeInfo().IsGenericParameter != yArgs[i].GetTypeInfo().IsGenericParameter)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this loop just call EqualSignatureTypes(xArgs[i], yArgs[i])? This probably means this method isn't needed and the recursion could happen in EqualSignatureTypes instead.

If this method stays it is spelt wrong.

@BitWizJason
Copy link
Author

Thank you @stakx and @jonorossi for reviewing. Pesky typos.... Good suggestions! Updated pull request.

@jonorossi
Copy link
Member

@BitWizJason Great. Before merging I wanted to make sure you are happy with the email address on those commits, that email address isn't associated with your GitHub account.

@BitWizJason
Copy link
Author

@jonorossi Thank you for pointing that out. I updated my profile. It should be associated now.

@jonorossi jonorossi changed the title Test cases and fix for issue #297 Fix MethodSignatureComparer to handle nested generics Sep 21, 2017
@jonorossi jonorossi merged commit 0fe6129 into castleproject:master Sep 21, 2017
@jonorossi jonorossi added this to the vNext milestone Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants