Skip to content

Commit a1b44d7

Browse files
committed
Also check for covariant return types if both of them are generic
1 parent be22332 commit a1b44d7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Castle.Core/DynamicProxy/Generators/MethodSignatureComparer.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,12 @@ private bool EqualSignatureTypes(Type x, Type y, MethodInfo xm = null, MethodInf
121121
return false;
122122
}
123123

124-
for (var i = 0; i < xArgs.Length; ++i)
124+
if (IsCovariantReturnTypes(x, y, xm, ym) == false)
125125
{
126-
if(!EqualSignatureTypes(xArgs[i], yArgs[i])) return false;
126+
for (var i = 0; i < xArgs.Length; ++i)
127+
{
128+
if(!EqualSignatureTypes(xArgs[i], yArgs[i])) return false;
129+
}
127130
}
128131
}
129132
else

0 commit comments

Comments
 (0)