diff dmd/CallExp.d @ 79:43073c7c7769

updated to 2.035 also implemented a few missing functions still crashes in Import.importAll though
author Trass3r
date Mon, 30 Aug 2010 03:57:51 +0200
parents ad4792a1cfd6
children be2ab491772e
line wrap: on
line diff
--- a/dmd/CallExp.d	Sun Aug 29 14:39:08 2010 +0100
+++ b/dmd/CallExp.d	Mon Aug 30 03:57:51 2010 +0200
@@ -1,5 +1,6 @@
 module dmd.CallExp;
 
+import dmd.ErrorExp;
 import dmd.Expression;
 import dmd.Cast;
 import dmd.WANT;
@@ -122,19 +123,20 @@
 	{
 		TypeFunction tf;
 		FuncDeclaration f;
-		int i;
 		Type t1;
 		int istemp;
 		Objects targsi;	// initial list of template arguments
 		TemplateInstance tierror;
 
-version (LOGSEMANTIC) {
+version (LOGSEMANTIC)
+{
 		printf("CallExp.semantic() %s\n", toChars());
 }
 		if (type)
 			return this;		// semantic() already run
 
-static if (false) {
+static if (false)
+{
 		if (arguments && arguments.dim)
 		{
 			Expression earg = cast(Expression)arguments.data[0];
@@ -613,8 +615,10 @@
 		{
 			OverExp eo = cast(OverExp)e1;
 			FuncDeclaration ff = null;
-			foreach(Dsymbol s; eo.vars.a)
-			{   
+			Dsymbol s = null;
+			for(size_t i = 0; i<eo.vars.a.dim; i++)
+			{
+				s = eo.vars.a[i];
 				FuncDeclaration f2 = s.isFuncDeclaration();
 				if (f2)
 				{
@@ -638,11 +642,10 @@
 				}
 			}
 			if (!ff)
-			{   
-				/* No overload matches, just set ff and rely on error
-				 * message being generated later.
-				 */
-				ff = cast(FuncDeclaration)eo.vars.a[0];
+			{
+				// No overload matches
+				error("no overload matches for %s", s.toChars());
+				return new ErrorExp();
 			}
 			e1 = new VarExp(loc, ff);
 			goto Lagain;