Mercurial > projects > ldc
comparison dmd/mtype.c @ 780:2cf440d511bb
Move tuple syntax copy for function arguments after semantic, to make sure
->ty contains the final value. Fixes run/t/tuple_20_A again.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 22 Nov 2008 18:45:09 +0100 |
parents | cd7da2ba14d1 |
children | 340acf1535d0 |
comparison
equal
deleted
inserted
replaced
779:ef7fe998f9b3 | 780:2cf440d511bb |
---|---|
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 | 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(); | |
2958 | |
2959 tf->inuse++; | 2954 tf->inuse++; |
2960 arg->type = arg->type->semantic(loc,sc); | 2955 arg->type = arg->type->semantic(loc,sc); |
2961 if (tf->inuse == 1) tf->inuse--; | 2956 if (tf->inuse == 1) tf->inuse--; |
2957 | |
2958 // each function needs its own copy of a tuple arg, since | |
2959 // they mustn't share arg flags like inreg, ... | |
2960 if (arg->type->ty == Ttuple) { | |
2961 arg->type = arg->type->syntaxCopy(); | |
2962 tf->inuse++; | |
2963 arg->type = arg->type->semantic(loc,sc); | |
2964 if (tf->inuse == 1) tf->inuse--; | |
2965 } | |
2966 | |
2962 t = arg->type->toBasetype(); | 2967 t = arg->type->toBasetype(); |
2963 | 2968 |
2964 if (arg->storageClass & (STCout | STCref | STClazy)) | 2969 if (arg->storageClass & (STCout | STCref | STClazy)) |
2965 { | 2970 { |
2966 if (t->ty == Tsarray) | 2971 if (t->ty == Tsarray) |