]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Prefer methods with more parameters when resolving importJava 63/1863/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Tue, 19 Jun 2018 13:24:25 +0000 (16:24 +0300)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Tue, 19 Jun 2018 13:24:25 +0000 (16:24 +0300)
gitlab #27

Change-Id: Idd6ec1a08f127a503c456cea45f5bda7dbf9703a

bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/generic/CallJava.java

index 0e3ad1f52c5daa3aad92cdb733374fb2b9c8373a..b5ba945797afcd350d1ca6ad2998c7515c2a8045 100644 (file)
@@ -62,8 +62,12 @@ public class CallJava extends FunctionValue {
         MethodRef m2 = other.methodRef;
         TypeDesc[] ps1 = m1.getParameterTypes();
         TypeDesc[] ps2 = m2.getParameterTypes();
-        if(ps1.length != ps2.length)
-            return INCOMPARABLE;
+        if(ps1.length != ps2.length) {
+            if(ps1.length < ps2.length)
+                return LESS;
+            else
+                return GREATER;
+        }
 
         boolean lessOrEqual = true;
         boolean greaterOrEqual = true;