comparison dmd/expression.c @ 876:27a379f288bf

Merged DMD 1.039
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 07 Jan 2009 19:34:48 +0100
parents 330f999ade44
children ea82e2077f9d
comparison
equal deleted inserted replaced
875:330f999ade44 876:27a379f288bf
3302 TypeExp::TypeExp(Loc loc, Type *type) 3302 TypeExp::TypeExp(Loc loc, Type *type)
3303 : Expression(loc, TOKtype, sizeof(TypeExp)) 3303 : Expression(loc, TOKtype, sizeof(TypeExp))
3304 { 3304 {
3305 //printf("TypeExp::TypeExp(%s)\n", type->toChars()); 3305 //printf("TypeExp::TypeExp(%s)\n", type->toChars());
3306 this->type = type; 3306 this->type = type;
3307 }
3308
3309 Expression *TypeExp::syntaxCopy()
3310 {
3311 //printf("TypeExp::syntaxCopy()\n");
3312 return new TypeExp(loc, type->syntaxCopy());
3307 } 3313 }
3308 3314
3309 Expression *TypeExp::semantic(Scope *sc) 3315 Expression *TypeExp::semantic(Scope *sc)
3310 { 3316 {
3311 //printf("TypeExp::semantic(%s)\n", type->toChars()); 3317 //printf("TypeExp::semantic(%s)\n", type->toChars());
7237 if (t->ty == Tvoid) 7243 if (t->ty == Tvoid)
7238 s = e1->toChars(); 7244 s = e1->toChars();
7239 else 7245 else
7240 s = t->toChars(); 7246 s = t->toChars();
7241 error("%s cannot be sliced with []", s); 7247 error("%s cannot be sliced with []", s);
7242 type = Type::terror; 7248 e = new IntegerExp(0);
7243 return e; 7249 return e;
7244 } 7250 }
7245 7251
7246 void SliceExp::checkEscape() 7252 void SliceExp::checkEscape()
7247 { 7253 {