From cbd6e0765c25ac9aa6e3955087f8b5c7df59fa1f Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 19 Apr 2007 13:50:29 +0000 Subject: [PATCH] Fixed bug that could cause SharpDevelop to treat two overloads as equal if they had the same parameter names but different parameter types. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.1@2493 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/Implementations/DefaultParameter.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultParameter.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultParameter.cs index eeb545dfa2..da902f0784 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultParameter.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultParameter.cs @@ -146,11 +146,16 @@ namespace ICSharpCode.SharpDevelop.Dom // two parameters are equal if they have the same return type // (they may have different names) - if (object.Equals(ReturnType, value.ReturnType)) + if (object.Equals(ReturnType, value.ReturnType)) { return 0; - else - return string.Compare(this.Name, value.Name); - // if the parameters are not equal, use the parameter name to provide the ordering + } else { + // if the parameters are not equal, use the parameter name to provide the ordering + int r = string.Compare(this.Name, value.Name); + if (r != 0) + return r; + else + return -1; // but equal names don't make parameters of different return types equal + } } int IComparable.CompareTo(object value)