From: Hannu Niemistö Date: Tue, 19 Jun 2018 13:24:25 +0000 (+0300) Subject: Prefer methods with more parameters when resolving importJava X-Git-Tag: v1.43.0~136^2~459 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F1863%2F1;p=simantics%2Fplatform.git Prefer methods with more parameters when resolving importJava gitlab #27 Change-Id: Idd6ec1a08f127a503c456cea45f5bda7dbf9703a --- diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/generic/CallJava.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/generic/CallJava.java index 0e3ad1f52..b5ba94579 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/generic/CallJava.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/generic/CallJava.java @@ -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;