comparison dmd/mtype.c @ 772:cd7da2ba14d1

Fix bug reported by downs. Related to delegate types within tuple template parameters.
author Christian Kamm <kamm incasoftware de>
date Tue, 18 Nov 2008 17:14:57 +0100
parents bfabbac8e705
children 2cf440d511bb
comparison
equal deleted inserted replaced
771:bfabbac8e705 772:cd7da2ba14d1
2948 { size_t dim = Argument::dim(tf->parameters); 2948 { size_t dim = Argument::dim(tf->parameters);
2949 2949
2950 for (size_t i = 0; i < dim; i++) 2950 for (size_t i = 0; i < dim; i++)
2951 { Argument *arg = Argument::getNth(tf->parameters, i); 2951 { Argument *arg = Argument::getNth(tf->parameters, i);
2952 Type *t; 2952 Type *t;
2953
2954 // each function needs its own copy of a tuple arg, since
2955 // they mustn't share arg flags like inreg, ...
2956 if (arg->type->ty == Ttuple)
2957 arg->type = arg->type->syntaxCopy();
2953 2958
2954 tf->inuse++; 2959 tf->inuse++;
2955 arg->type = arg->type->semantic(loc,sc); 2960 arg->type = arg->type->semantic(loc,sc);
2956 if (tf->inuse == 1) tf->inuse--; 2961 if (tf->inuse == 1) tf->inuse--;
2957 t = arg->type->toBasetype(); 2962 t = arg->type->toBasetype();
3464 t = t->semantic(loc, scx); 3469 t = t->semantic(loc, scx);
3465 //((TypeIdentifier *)t)->resolve(loc, scx, pe, &t, ps); 3470 //((TypeIdentifier *)t)->resolve(loc, scx, pe, &t, ps);
3466 } 3471 }
3467 } 3472 }
3468 if (t->ty == Ttuple) 3473 if (t->ty == Ttuple)
3469 *pt = t->syntaxCopy(); 3474 *pt = t;
3470 else 3475 else
3471 *pt = t->merge(); 3476 *pt = t->merge();
3472 } 3477 }
3473 if (!s) 3478 if (!s)
3474 { 3479 {