Mercurial > projects > ddmd
changeset 60:a8740d0dbea4
TypeTypeof.toCBuffer2
BinExp.semanticp bug fixed
author | korDen |
---|---|
date | Mon, 23 Aug 2010 02:48:05 +0400 |
parents | 35afd9294854 |
children | 4ae0d790a452 |
files | dmd/BinExp.d dmd/TypeTypeof.d |
diffstat | 2 files changed, 16 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/dmd/BinExp.d Sat Aug 21 14:54:46 2010 +0400 +++ b/dmd/BinExp.d Mon Aug 23 02:48:05 2010 +0400 @@ -78,7 +78,7 @@ int typeMerge(Scope sc, Expression e, Type* pt, Expression* pe1, Expression* pe2) { - //printf("typeMerge() %s op %s\n", (*pe1).toChars(), (*pe2).toChars()); + //printf("typeMerge() %.*s op %.*s\n", (*pe1).toChars(), (*pe2).toChars()); //dump(0); Expression e1 = (*pe1).integralPromotions(sc); @@ -385,7 +385,7 @@ Expression semantic(Scope sc) { version (LOGSEMANTIC) { - printf("BinExp.semantic('%s')\n", toChars()); + printf("BinExp.semantic('%.*s')\n", toChars()); } e1 = e1.semantic(sc); if (!e1.type && !(op == TOK.TOKassign && e1.op == TOK.TOKdottd)) // a.template = e2 @@ -404,22 +404,10 @@ Expression semanticp(Scope sc) { -version (LOGSEMANTIC) { - printf("BinExp.semantic('%s')\n", toChars()); -} - e1 = e1.semantic(sc); - if (!e1.type && - !(op == TOK.TOKassign && e1.op == TOK.TOKdottd)) // a.template = e2 - { - error("%s has no value", e1.toChars()); - e1.type = Type.terror; - } - e2 = e2.semantic(sc); - if (!e2.type) - { - error("%s has no value", e2.toChars()); - e2.type = Type.terror; - } + BinExp.semantic(sc); + + e1 = resolveProperties(sc, e1); + e2 = resolveProperties(sc, e2); return this; }
--- a/dmd/TypeTypeof.d Sat Aug 21 14:54:46 2010 +0400 +++ b/dmd/TypeTypeof.d Mon Aug 23 02:48:05 2010 +0400 @@ -54,7 +54,15 @@ void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod) { - assert(false); + if (mod != this.mod) + { + toCBuffer3(buf, hgs, mod); + return; + } + buf.writestring("typeof("); + exp.toCBuffer(buf, hgs); + buf.writeByte(')'); + toCBuffer2Helper(buf, hgs); } Type semantic(Loc loc, Scope sc) @@ -62,7 +70,7 @@ Expression e; Type t; - //printf("TypeTypeof.semantic() %p\n", this); + //printf("TypeTypeof.semantic() %.*s\n", toChars()); //static int nest; if (++nest == 50) *(char*)0=0;