Detecting a property setter?
    Rory McGuire 
    rmcguire at neonova.co.za
       
    Mon Jul 19 14:37:22 PDT 2010
    
    
  
On Mon, 19 Jul 2010 23:25:01 +0200, Jonathan M Davis  
<jmdavisprog at gmail.com> wrote:
> On Monday, July 19, 2010 13:42:51 Philippe Sigaud wrote:
>> On Mon, Jul 19, 2010 at 22:06, Simen kjaeraas  
>> <simen.kjaras at gmail.com>wrote:
>> > template hasSetter(alias func) if (isCallable!(func)) {
>> >
>> >    enum hasSetter = isProperty!(func) &&
>> >
>> >        is( typeof( (){ func = ReturnType!(func).init; } ) );
>> >
>> > }
>>
>> In that case, for the second func, the one you call ReturnType on, how  
>> does
>> the compiler knows it must take the ref uint one (the getter) and not  
>> the
>> void func() one?
>>
>>
>> Philippe
>
> I don't think that you're supposed to be able to have a getter property
> returning a ref at the same time that you have a setter property with  
> the same
> name. It certainly sounds like it should be a bug in any case.
>
> - Jonathan M Davis
I suppose it would be seen as a bug because it possibly circumvents the  
getter/setter
philosophy (If you return the internal value anyway).
    
    
More information about the Digitalmars-d-learn
mailing list