[Bug 191] New: Cannot refer to member variable in default value for method parameter

Deewiant deewiant.doesnotlike.spam at gmail.com
Mon Jun 12 10:14:12 PDT 2006


Bruno Medeiros wrote:
> Deewiant wrote:
>> Jarrett Billingsley wrote:
>>> Is this even in the spec?  I had no idea you were supposed to be allowed
>>> to use members as default parameters.
>> 
>> All I can find about default parameters in the spec is at the "Functions"
>> page, where they pop out of the blue in the phrase "A function parameter's 
>> default value is not inherited", which is all that's said about them. The 
>> changelog for DMD 0.92 also says "Added default arguments to function
>> parameters. Semantics are like C++." but that's it.
>> 
>> After some testing, it seems that that would actually explain it: C++ 
>> doesn't allow it.
>> 
> 
> Which then means this is not a bug. What shall it be now? (dropped issue?,
> documentation clarification request?, enhancement request?)
> 

If you ask me, it's both of the latter. The documentation certainly needs
improvement in this regard, and I certainly want to be able to use class members
as default parameters. <g>



More information about the Digitalmars-d-bugs mailing list