public virtual bool ConflictWith(MethodSignature method)
{
if (Name.ToLower() != method.Name.ToLower()) {
return false;
}
if (Parameters.Count != method.Arguments.Length)
return false;
if (ReturnType.IsVoid != method.ReturnType.IsVoid)
return false;
bool conflict = false;
bool abs = false;
bool sameArgs = true;
int i = 0;
foreach (Argument arg in method.Arguments) {
ParameterData param = (ParameterData) Parameters[i++];
TypeData type1 = arg.NodeType;
TypeData type2 = param.ParameterType;
if (type1 != type2)
sameArgs = false;
if (type1 != type2 &&
!type1.IsAbstract && !type2.IsAbstract) {
return false;
}
else {
if (type1.IsAbstract && type2.IsAbstract) {
abs = true;
if (!(type1.IsSubtypeOf(type2) ||
type2.IsSubtypeOf(type1)))
conflict = true;
}
else {
if (type1 != type2)
return false;
}
}
}
return (abs && conflict) || !abs || sameArgs;
}