Mercurial > projects > ddmd
diff dmd/Expression.d @ 73:ef02e2e203c2
Updating to dmd2.033
author | korDen |
---|---|
date | Sat, 28 Aug 2010 19:42:41 +0400 |
parents | efb1e5bdf63c |
children | be2ab491772e |
line wrap: on
line diff
--- a/dmd/Expression.d Sat Aug 28 16:19:48 2010 +0200 +++ b/dmd/Expression.d Sat Aug 28 19:42:41 2010 +0400 @@ -530,7 +530,11 @@ { IntRange ir; ir.imin = 0; - ir.imax = type.sizemask(); + if (type.isintegral()) + ir.imax = type.sizemask(); + else + ir.imax = 0xFFFFFFFFFFFFFFFFUL; // assume the worst + return ir; } @@ -741,8 +745,9 @@ Expression deref() { //printf("Expression::deref()\n"); - if (type.ty == TY.Treference) - { + // type could be null if forward referencing an 'auto' variable + if (type && type.ty == Treference) + { Expression e = new PtrExp(loc, this); e.type = (cast(TypeReference)type).next; return e; @@ -863,7 +868,11 @@ { if (flag == 0) { - if (op == TOKimport) + if (op == TOKerror) + { + // Error should have already been printed + } + else if (op == TOKimport) error("%s has no effect", toChars()); else error("%s has no effect in expression (%s)",