Mercurial > projects > ldc
diff dmd/expression.c @ 717:a26b0c5d5942
Merged DMD 1.036.
Improved comments a little in the runtime source code.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 22 Oct 2008 17:06:17 +0200 |
parents | eef8ac26c66c |
children | 55f6c2e454d7 |
line wrap: on
line diff
--- a/dmd/expression.c Wed Oct 22 15:35:46 2008 +0200 +++ b/dmd/expression.c Wed Oct 22 17:06:17 2008 +0200 @@ -4634,7 +4634,8 @@ printf("BinExp::semantic('%s')\n", toChars()); #endif e1 = e1->semantic(sc); - if (!e1->type) + if (!e1->type && + !(op == TOKassign && e1->op == TOKdottd)) // a.template = e2 { error("%s has no value", e1->toChars()); e1->type = Type::terror; @@ -4645,7 +4646,6 @@ error("%s has no value", e2->toChars()); e2->type = Type::terror; } - assert(e1->type); return this; } @@ -7351,6 +7351,14 @@ } BinExp::semantic(sc); + + if (e1->op == TOKdottd) + { // Rewrite a.b=e2, when b is a template, as a.b(e2) + Expression *e = new CallExp(loc, e1, e2); + e = e->semantic(sc); + return e; + } + e2 = resolveProperties(sc, e2); assert(e1->type);