On Thursday, 8 March 2012 at 00:04:55 UTC, Ali Çehreli wrote:
On 03/07/2012 03:54 PM, Ali Çehreli wrote:
On 03/07/2012 03:21 PM, Comrad wrote:
> 1 struct A
> 2 {
> 3 double[2] _x;
> 4 }
> 5
> 6 @property ref double y(ref A a) {return a._x[1];}
> 7
> 8 void main()
> 9 {
> 10 A a1;
> 11 a1.y=2.;
> 12 }
>
> dmd test.d gives me:
>
> Error: no property 'y' for type 'A'
>
>

You are testing out the new UFCS, right? Well, I really really hope that I will be embarrassed by saying this: That feature has been DOA! :p

So many people celebrated the feature on the D.announce newsgroup. I've pointed out a number of times that I couldn't get even the simplest test.

And there is a unittest that tests the feature but nope... It just
doesn't work. :(

Ali


Ok, now I see how I fooled myself. Posts like the following made me think that UFCS has been implemented even for ints:

  http://forum.dlang.org/post/jhfpca$1bf4$1...@digitalmars.com

I made a further mistake and parsed the unittest in the following change as using an 'int'. Obviously I was wrong: it is the string literal "1":


https://github.com/D-Programming-Language/dmd/commit/c268c4a2dc20aae024bce81555833b806a56f718

Ali

Basically, I was following Andrei's book, where this feature is described. It's a pity, that it's not working (except arrays somehow) :( - I need it!

Reply via email to