Browse Source

Merge pull request #106908 from dsnopek/java-class-wrapper-object-type-bug

JavaClassWrapper: Don't discard overloaded methods that differ by object type
Thaddeus Crews 3 months ago
parent
commit
f8a478115d
1 changed files with 4 additions and 1 deletions
  1. 4 1
      platform/android/java_class_wrapper.cpp

+ 4 - 1
platform/android/java_class_wrapper.cpp

@@ -1600,9 +1600,12 @@ Ref<JavaClass> JavaClassWrapper::_wrap(const String &p_class, bool p_allow_priva
 				if (_new != existing) {
 					this_valid = false;
 					break;
+				} else if ((_new == Variant::OBJECT || _new == Variant::ARRAY) && E->get().param_sigs[j] != mi.param_sigs[j]) {
+					this_valid = false;
+					break;
 				}
 				new_likeliness += new_l;
-				existing_likeliness = existing_l;
+				existing_likeliness += existing_l;
 			}
 
 			if (!this_valid) {