2004-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 2 Jun 2004 14:30:56 +0000 (14:30 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 2 Jun 2004 14:30:56 +0000 (14:30 -0000)
* Binder.cs: default score must be lower than fail_score or we'll get
an ambiguous match when no indexers given and one single match is found.

svn path=/trunk/mcs/; revision=28698

mcs/class/corlib/System.Reflection/Binder.cs
mcs/class/corlib/System.Reflection/ChangeLog

index 0fad9b8ef368609445d5ffd10a82594f59f33a35..6cef7944f78cc3d520bfbe9dc8b6635228f02be6 100644 (file)
@@ -320,7 +320,7 @@ namespace System.Reflection
                                int idxlen = (indexes != null) ? indexes.Length : 0;
                                PropertyInfo result = null;
                                int i;
-                               int best_score = Int32.MaxValue;
+                               int best_score = Int32.MaxValue - 1;
                                int fail_score = Int32.MaxValue;
                                int level = 0;
                                
@@ -333,7 +333,7 @@ namespace System.Reflection
                                        if (haveRet && !check_type (p.PropertyType, returnType))
                                                continue;
 
-                                       int score = Int32.MaxValue;
+                                       int score = Int32.MaxValue - 1;
                                        if (idxlen > 0) {
                                                score = check_arguments_with_score (indexes, args);
                                                if (score == -1)
index 7e7ee50bce045d5fa307b766766414603ada4a22..55f00a5b49814751dc69cb9a7bf2268ddc187cfb 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * Binder.cs: default score must be lower than fail_score or we'll get
+       an ambiguous match when no indexers given and one single match is found.
+
 2004-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * Binder.cs: removed ^Ms. In case of several properties matching, try