Browse Source

Fixed SD2-1287: Method signatures are not compared correctly

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.1@2339 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
d9e3f0b6f3
  1. 2
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/AbstractReturnType.cs
  2. 5
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultReturnType.cs
  3. 14
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/GetClassReturnType.cs
  4. 14
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/SearchClassReturnType.cs

2
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/AbstractReturnType.cs

@ -31,7 +31,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -31,7 +31,7 @@ namespace ICSharpCode.SharpDevelop.Dom
{
IReturnType rt = o as IReturnType;
if (rt == null) return false;
return rt.IsDefaultReturnType && this.FullyQualifiedName == rt.FullyQualifiedName && this.TypeParameterCount == rt.TypeParameterCount;
return rt.IsDefaultReturnType && DefaultReturnType.Equals(this, rt);
}
public override int GetHashCode()

5
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultReturnType.cs

@ -17,6 +17,11 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -17,6 +17,11 @@ namespace ICSharpCode.SharpDevelop.Dom
/// </summary>
public class DefaultReturnType : AbstractReturnType
{
public static bool Equals(IReturnType rt1, IReturnType rt2)
{
return rt1.FullyQualifiedName == rt2.FullyQualifiedName && rt1.TypeParameterCount == rt2.TypeParameterCount;
}
IClass c;
public DefaultReturnType(IClass c)

14
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/GetClassReturnType.cs

@ -41,15 +41,11 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -41,15 +41,11 @@ namespace ICSharpCode.SharpDevelop.Dom
public override bool Equals(object o)
{
GetClassReturnType rt = o as GetClassReturnType;
if (rt == null) {
IReturnType rt2 = o as IReturnType;
if (rt2 != null && rt2.IsDefaultReturnType)
return rt2.FullyQualifiedName == fullName && rt2.TypeParameterCount == this.TypeParameterCount;
else
return false;
}
return fullName == rt.fullName && typeParameterCount == rt.typeParameterCount && content == rt.content;
IReturnType rt = o as IReturnType;
if (rt != null && rt.IsDefaultReturnType)
return DefaultReturnType.Equals(this, rt);
else
return false;
}
public override int GetHashCode()

14
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/SearchClassReturnType.cs

@ -49,21 +49,9 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -49,21 +49,9 @@ namespace ICSharpCode.SharpDevelop.Dom
public override bool Equals(object o)
{
SearchClassReturnType rt = o as SearchClassReturnType;
if (rt != null) {
if (name != rt.name)
return false;
if (declaringClass.FullyQualifiedName == rt.declaringClass.FullyQualifiedName
&& typeParameterCount == rt.typeParameterCount
&& caretLine == rt.caretLine
&& caretColumn == rt.caretColumn)
{
return true;
}
}
IReturnType rt2 = o as IReturnType;
if (rt2 != null && rt2.IsDefaultReturnType)
return rt2.FullyQualifiedName == this.FullyQualifiedName && rt2.TypeParameterCount == this.TypeParameterCount;
return DefaultReturnType.Equals(this, rt2);
else
return false;
}

Loading…
Cancel
Save