Mercurial > projects > ldc
comparison dmd2/mtype.c @ 822:43178a913a28
Removed PAGESIZE part of Tango patch, it works for me when the check is removed.
Updated Tango patch to latest Tango revision.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Tue, 02 Dec 2008 02:45:31 +0100 |
parents | 340acf1535d0 |
children | 356e65836fb5 |
comparison
equal
deleted
inserted
replaced
821:8f0b24bc55f0 | 822:43178a913a28 |
---|---|
3463 if (arg->defaultArg) | 3463 if (arg->defaultArg) |
3464 { | 3464 { |
3465 arg->defaultArg = arg->defaultArg->semantic(sc); | 3465 arg->defaultArg = arg->defaultArg->semantic(sc); |
3466 arg->defaultArg = resolveProperties(sc, arg->defaultArg); | 3466 arg->defaultArg = resolveProperties(sc, arg->defaultArg); |
3467 arg->defaultArg = arg->defaultArg->implicitCastTo(sc, arg->type); | 3467 arg->defaultArg = arg->defaultArg->implicitCastTo(sc, arg->type); |
3468 | |
3469 // make sure default arguments only use variables with lower protection | |
3470 // this check only catches the common case that the default arg Exp is a VarExp | |
3471 if(arg->defaultArg->op == TOKvar) | |
3472 { VarExp *ve = (VarExp *)arg->defaultArg; | |
3473 if(ve->var->protection != PROTundefined && ve->var->protection < sc->protection) | |
3474 error(loc, "default argument %s has stronger protection than function %s", ve->var->toChars(), toChars()); | |
3475 } | |
3476 } | 3468 } |
3477 | 3469 |
3478 /* If arg turns out to be a tuple, the number of parameters may | 3470 /* If arg turns out to be a tuple, the number of parameters may |
3479 * change. | 3471 * change. |
3480 */ | 3472 */ |