On 26/04/12 11:28, Timon Gehr wrote:
On 04/26/2012 10:51 AM, Don Clugston wrote:
On 26/04/12 05:44, Walter Bright wrote:
A subtle but nasty problem - are default arguments part of the type, or
part of the declaration?

See http://d.puremagic.com/issues/show_bug.cgi?id=3866

Currently, they are both, which leads to the nasty behavior in the bug
report.

The problem centers around name mangling. If two types mangle the same,
then they are the same type. But default arguments are not part of the
mangled string. Hence the schizophrenic behavior.

But if we make default arguments solely a part of the function
declaration, then function pointers (and delegates) cannot have default
arguments. (And maybe this isn't a bad thing?)

I think it is a mistake to allow default arguments in function pointers
and delegates (it's OK for delegate literals, there you have the
declaration).

The parenthesised part is in conflict with your other statement.

No it doesn't. A default argument is a delegate literal is part of the declaration, not part of the type.

Reply via email to