summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2008-06-02 18:27:41 +0000
committerRich Hickey <richhickey@gmail.com>2008-06-02 18:27:41 +0000
commitbdc3823cc58c986c7dcd6e3c098f10b9709fdc5c (patch)
tree5f392b26538d4b3a219927b1ac3d1624b7e24b87 /src
parent1206781b751321716b1cd7a85331d9991a12f5bd (diff)
fixed getMatchingParams if tie was found before best match
Diffstat (limited to 'src')
-rw-r--r--src/jvm/clojure/lang/Compiler.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java
index c5781106..673f5a06 100644
--- a/src/jvm/clojure/lang/Compiler.java
+++ b/src/jvm/clojure/lang/Compiler.java
@@ -1898,6 +1898,7 @@ static int getMatchingParams(String methodName, ArrayList<Class[]> paramlists, I
throws Exception{
//presumes matching lengths
int matchIdx = -1;
+ boolean tied = false;
for(int i = 0; i < paramlists.size(); i++)
{
boolean match = true;
@@ -1915,12 +1916,18 @@ static int getMatchingParams(String methodName, ArrayList<Class[]> paramlists, I
else
{
if(subsumes(paramlists.get(i), paramlists.get(matchIdx)))
+ {
matchIdx = i;
+ tied = false;
+ }
else if(!subsumes(paramlists.get(matchIdx), paramlists.get(i)))
- throw new IllegalArgumentException("More than one matching method found: " + methodName);
+ tied = true;
}
}
}
+ if(tied)
+ throw new IllegalArgumentException("More than one matching method found: " + methodName);
+
return matchIdx;
}