Mercurial > projects > ldc
comparison dmd/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 | bc982f1ad106 |
comparison
equal
deleted
inserted
replaced
821:8f0b24bc55f0 | 822:43178a913a28 |
---|---|
2977 if (arg->defaultArg) | 2977 if (arg->defaultArg) |
2978 { | 2978 { |
2979 arg->defaultArg = arg->defaultArg->semantic(sc); | 2979 arg->defaultArg = arg->defaultArg->semantic(sc); |
2980 arg->defaultArg = resolveProperties(sc, arg->defaultArg); | 2980 arg->defaultArg = resolveProperties(sc, arg->defaultArg); |
2981 arg->defaultArg = arg->defaultArg->implicitCastTo(sc, arg->type); | 2981 arg->defaultArg = arg->defaultArg->implicitCastTo(sc, arg->type); |
2982 | |
2983 // make sure default arguments only use variables with lower protection | |
2984 // this check only catches the common case that the default arg Exp is a VarExp | |
2985 if(arg->defaultArg->op == TOKvar) | |
2986 { VarExp *ve = (VarExp *)arg->defaultArg; | |
2987 if(ve->var->protection != PROTundefined && ve->var->protection < sc->protection) | |
2988 error(loc, "default argument %s has stronger protection than function %s", ve->var->toChars(), toChars()); | |
2989 } | |
2990 } | 2982 } |
2991 | 2983 |
2992 /* If arg turns out to be a tuple, the number of parameters may | 2984 /* If arg turns out to be a tuple, the number of parameters may |
2993 * change. | 2985 * change. |
2994 */ | 2986 */ |