Mercurial > projects > ddmd
comparison dmd/TypeSArray.d @ 113:3482c73a991b
More cleanup for arrays
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Tue, 31 Aug 2010 23:57:32 +0100 |
parents | 12c0c84d13fd |
children | e28b18c23469 |
comparison
equal
deleted
inserted
replaced
112:3f02152c5e68 | 113:3482c73a991b |
---|---|
127 /// error(loc, "%s is not a type", toChars()); | 127 /// error(loc, "%s is not a type", toChars()); |
128 /// return Type.terror; | 128 /// return Type.terror; |
129 ///} | 129 ///} |
130 ///t = cast(Type)o; | 130 ///t = cast(Type)o; |
131 | 131 |
132 t = cast(Type)sd.objects.data[cast(size_t)d]; | 132 t = cast(Type)sd.objects[cast(size_t)d]; |
133 if (t is null) { | 133 if (t is null) { |
134 error(loc, "%s is not a type", toChars()); | 134 error(loc, "%s is not a type", toChars()); |
135 return Type.terror; | 135 return Type.terror; |
136 } | 136 } |
137 return t; | 137 return t; |
255 if (d >= td.objects.dim) | 255 if (d >= td.objects.dim) |
256 { | 256 { |
257 error(loc, "tuple index %ju exceeds %u", d, td.objects.dim); | 257 error(loc, "tuple index %ju exceeds %u", d, td.objects.dim); |
258 goto Ldefault; | 258 goto Ldefault; |
259 } | 259 } |
260 Object o = cast(Object)td.objects.data[cast(size_t)d]; | 260 Object o = td.objects[cast(size_t)d]; |
261 if ((*ps = isDsymbol(o)) !is null) /// ! | 261 if ((*ps = isDsymbol(o)) !is null) /// ! |
262 { | 262 { |
263 return; | 263 return; |
264 } | 264 } |
265 if ((*pe = isExpression(o)) !is null) /// ! | 265 if ((*pe = isExpression(o)) !is null) /// ! |
509 goto Lnomatch; | 509 goto Lnomatch; |
510 TemplateParameter tp2 = cast(TemplateParameter)parameters.data[i]; | 510 TemplateParameter tp2 = cast(TemplateParameter)parameters.data[i]; |
511 TemplateValueParameter tvp = tp2.isTemplateValueParameter(); | 511 TemplateValueParameter tvp = tp2.isTemplateValueParameter(); |
512 if (!tvp) | 512 if (!tvp) |
513 goto Lnomatch; | 513 goto Lnomatch; |
514 Expression e = cast(Expression)dedtypes.data[i]; | 514 Expression e = cast(Expression)dedtypes[i]; |
515 if (e) | 515 if (e) |
516 { | 516 { |
517 if (!dim.equals(e)) | 517 if (!dim.equals(e)) |
518 goto Lnomatch; | 518 goto Lnomatch; |
519 } | 519 } |
549 // Found the corresponding template parameter | 549 // Found the corresponding template parameter |
550 TemplateValueParameter tvp = tp2.isTemplateValueParameter(); | 550 TemplateValueParameter tvp = tp2.isTemplateValueParameter(); |
551 if (!tvp || !tvp.valType.isintegral()) | 551 if (!tvp || !tvp.valType.isintegral()) |
552 goto Lnomatch; | 552 goto Lnomatch; |
553 | 553 |
554 if (dedtypes.data[i]) | 554 if (dedtypes[i]) |
555 { | 555 { |
556 if (!dim.equals(cast(Object)dedtypes.data[i])) | 556 if (!dim.equals(dedtypes[i])) |
557 goto Lnomatch; | 557 goto Lnomatch; |
558 } | 558 } |
559 else | 559 else |
560 { dedtypes[i] = dim; | 560 { dedtypes[i] = dim; |
561 } | 561 } |