2
0
Эх сурвалжийг харах

patch for overloaded operators with parameters of procedure type (delegate vs non-delegate)

git-svn-id: https://svn-dept.inf.ethz.ch/svn/lecturers/a2/trunk@8866 8c9fc860-2736-0410-a75d-ab315db34111
felixf 6 жил өмнө
parent
commit
a0d4a1a7a4

+ 6 - 0
source/FoxSemanticChecker.Mod

@@ -8553,6 +8553,12 @@ TYPE
 			rightParameter := right.firstParameter;
 			i := 0;
 			result := 0;
+			IF right.isDelegate & ~procedureType.isDelegate THEN
+				result := Infinity;
+			ELSIF procedureType.isDelegate & ~right.isDelegate THEN
+				INC(result);
+			END; 
+			
 			(*! taken from paco, seems to not be 100% correct, check (in particular array part -> length of arrays??) *)
 			WHILE (formalParameter # NIL) & (result # Infinity) DO
 				distance := TypeDistance(system,rightParameter.type.resolved,formalParameter.type.resolved,formalParameter.kind = SyntaxTree.VarParameter);