Browse Source

Some method matching stuff with equals

kindlich 4 years ago
parent
commit
06b0859ce2
No known key found for this signature in database

+ 3
- 1
CodeModel/src/main/java/org/openzen/zenscript/codemodel/type/member/TypeMemberGroup.java View File

@@ -374,7 +374,9 @@ public class TypeMemberGroup {
374 374
 			
375 375
 			if (selected == null) {
376 376
 				selected = method;
377
-			} else if(selected.priority == method.priority){
377
+			} else if (selected.member.equals(method.member)) {
378
+                selected = selected.resolve(method);
379
+            } else if(selected.priority == method.priority){
378 380
 				StringBuilder explanation = new StringBuilder();
379 381
 				FunctionHeader selectedHeader = selected.member.getHeader().instanceForCall(position, scope.getTypeRegistry(), arguments);
380 382
 				explanation.append("Function A: ").append(selectedHeader.toString()).append("\n");

+ 2
- 2
CodeModel/src/main/java/org/openzen/zenscript/codemodel/type/member/TypeMembers.java View File

@@ -453,12 +453,12 @@ public final class TypeMembers {
453 453
 	}
454 454
 	
455 455
 	private boolean areEquivalent(StoredType fromType, StoredType toType) {
456
-		if (fromType == toType)
456
+		if (fromType == toType || fromType.equals(toType))
457 457
 			return true;
458 458
 		if (!fromType.getActualStorage().canCastTo(toType.getActualStorage()) && !toType.getActualStorage().canCastFrom(fromType.getActualStorage()))
459 459
 			return false;
460 460
 		
461
-		return fromType.type == toType.type;
461
+		return fromType.type.equals(toType.type);
462 462
 	}
463 463
 	
464 464
 	public CasterMemberRef getImplicitCaster(StoredType toType) {

Loading…
Cancel
Save