comparison 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
comparison
equal deleted inserted replaced
78:b98fa8a4bf04 79:43073c7c7769
1 module dmd.CallExp; 1 module dmd.CallExp;
2 2
3 import dmd.ErrorExp;
3 import dmd.Expression; 4 import dmd.Expression;
4 import dmd.Cast; 5 import dmd.Cast;
5 import dmd.WANT; 6 import dmd.WANT;
6 import dmd.BUILTIN; 7 import dmd.BUILTIN;
7 import dmd.TypeFunction; 8 import dmd.TypeFunction;
120 121
121 override Expression semantic(Scope sc) 122 override Expression semantic(Scope sc)
122 { 123 {
123 TypeFunction tf; 124 TypeFunction tf;
124 FuncDeclaration f; 125 FuncDeclaration f;
125 int i;
126 Type t1; 126 Type t1;
127 int istemp; 127 int istemp;
128 Objects targsi; // initial list of template arguments 128 Objects targsi; // initial list of template arguments
129 TemplateInstance tierror; 129 TemplateInstance tierror;
130 130
131 version (LOGSEMANTIC) { 131 version (LOGSEMANTIC)
132 {
132 printf("CallExp.semantic() %s\n", toChars()); 133 printf("CallExp.semantic() %s\n", toChars());
133 } 134 }
134 if (type) 135 if (type)
135 return this; // semantic() already run 136 return this; // semantic() already run
136 137
137 static if (false) { 138 static if (false)
139 {
138 if (arguments && arguments.dim) 140 if (arguments && arguments.dim)
139 { 141 {
140 Expression earg = cast(Expression)arguments.data[0]; 142 Expression earg = cast(Expression)arguments.data[0];
141 earg.print(); 143 earg.print();
142 if (earg.type) earg.type.print(); 144 if (earg.type) earg.type.print();
611 } 613 }
612 else if (e1.op == TOK.TOKoverloadset) 614 else if (e1.op == TOK.TOKoverloadset)
613 { 615 {
614 OverExp eo = cast(OverExp)e1; 616 OverExp eo = cast(OverExp)e1;
615 FuncDeclaration ff = null; 617 FuncDeclaration ff = null;
616 foreach(Dsymbol s; eo.vars.a) 618 Dsymbol s = null;
617 { 619 for(size_t i = 0; i<eo.vars.a.dim; i++)
620 {
621 s = eo.vars.a[i];
618 FuncDeclaration f2 = s.isFuncDeclaration(); 622 FuncDeclaration f2 = s.isFuncDeclaration();
619 if (f2) 623 if (f2)
620 { 624 {
621 f2 = f2.overloadResolve(loc, null, arguments, 1); 625 f2 = f2.overloadResolve(loc, null, arguments, 1);
622 } 626 }
636 else 640 else
637 ff = f2; 641 ff = f2;
638 } 642 }
639 } 643 }
640 if (!ff) 644 if (!ff)
641 { 645 {
642 /* No overload matches, just set ff and rely on error 646 // No overload matches
643 * message being generated later. 647 error("no overload matches for %s", s.toChars());
644 */ 648 return new ErrorExp();
645 ff = cast(FuncDeclaration)eo.vars.a[0];
646 } 649 }
647 e1 = new VarExp(loc, ff); 650 e1 = new VarExp(loc, ff);
648 goto Lagain; 651 goto Lagain;
649 } 652 }
650 else if (!t1) 653 else if (!t1)