auto x = property: variable x cannot be declared to be a function

Lionello Lunesu lionello at lunesu.remove.com
Fri Nov 24 12:23:34 PST 2006


"Stewart Gordon" <smjg_1998 at yahoo.com> wrote in message 
news:ek7j2c$1rk9$1 at digitaldaemon.com...
> Lionello Lunesu wrote:
>> When converting a (public) variable into a property (get/set) I suddenly 
>> got the compiler error mentioned in the subject.
>>
>> The following code is a minimal test case:
>>
>> #int prop() { return 0; }
>> #void main() {
>> #  auto x = prop;
>> #}
> <snip>
>> Would it break anything to treat this case such that a property behaves 
>> more like a variable, meaning that the type deferred would be the return 
>> type of the getter?
>
> No.  AIUI property getting is what your code is supposed to do.

Yes, that's what I meant :S

L. 





More information about the Digitalmars-d-bugs mailing list