From ef969b71e1a0b8eabe93444cabaaf4960e7d1459 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Tue, 19 Jun 2018 16:24:25 +0300 Subject: [PATCH] Prefer methods with more parameters when resolving importJava gitlab #27 Change-Id: Idd6ec1a08f127a503c456cea45f5bda7dbf9703a --- .../scl/compiler/constants/generic/CallJava.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; -- 2.47.1