Skip to content

Commit

Permalink
Remove unnecessary type check
Browse files Browse the repository at this point in the history
The check being removed here was introduced by devlooped#335, which fixed a
regression by reproducing type matching logic from the .NET reference
source for `Type.GetMethod(string, BindingFlags, Binder, Type[], ..)`.

This check is likely not needed, and we have no test that demonstrates
why it might be needed.

Removing this special check however will allow us to merge the method
it appears in with other similar methods.
  • Loading branch information
stakx committed Sep 3, 2018
1 parent e074bfe commit eda7c3e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Moq/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,7 @@ public static bool HasCompatibleParameterTypes(this MethodInfo method, Type[] pa
for (int i = 0; i < parameters.Length; i++)
{
var parameterType = paramTypes[i];
if (parameterType == typeof(object))
{
continue;
}
else if (exactParameterMatch && parameters[i].ParameterType != parameterType)
if (exactParameterMatch && parameters[i].ParameterType != parameterType)
{
return false;
}
Expand Down

0 comments on commit eda7c3e

Please sign in to comment.