Behaviour of alias this changed

2012-05-08 Thread H. S. Teoh
I have some code along these lines: struct S { short[4] data; alias this data; string toString() { ... } } ... S s; writeln(to!string(s)); In dmd 2.059 (I believe) and earlier, this calls S.toString(). Howeve

Re: Behaviour of alias this changed

2012-05-08 Thread Ali Çehreli
On 05/08/2012 10:11 AM, H. S. Teoh wrote: I have some code along these lines: struct S { short[4] data; alias this data; string toString() { ... } } ... S s; writeln(to!string(s)); In dmd 2.059 (I believe)

Re: Behaviour of alias this changed

2012-05-08 Thread Gor Gyolchanyan
My guess is - it's a bug, because alias this is supposed to be always less prioritized, then actual members. On Tue, May 8, 2012 at 9:11 PM, H. S. Teoh wrote: > I have some code along these lines: > >        struct S { >                short[4] data; >                alias this data; > >        

Re: Behaviour of alias this changed

2012-05-08 Thread H. S. Teoh
On Tue, May 08, 2012 at 10:15:00AM -0700, Ali Çehreli wrote: > On 05/08/2012 10:11 AM, H. S. Teoh wrote: > >I have some code along these lines: > > > > struct S { > > short[4] data; > > alias this data; > > > > string toString() { ... } > > } > > ...

Re: Behaviour of alias this changed

2012-05-08 Thread Jonathan M Davis
On Tuesday, May 08, 2012 10:30:53 H. S. Teoh wrote: > On Tue, May 08, 2012 at 10:15:00AM -0700, Ali Çehreli wrote: > > On 05/08/2012 10:11 AM, H. S. Teoh wrote: > > >I have some code along these lines: > > > struct S { > > > > > > short[4] data; > > > alias this data; > > > > > > string toString(

Re: Behaviour of alias this changed

2012-05-08 Thread H. S. Teoh
On Tue, May 08, 2012 at 01:52:14PM -0400, Jonathan M Davis wrote: > On Tuesday, May 08, 2012 10:30:53 H. S. Teoh wrote: > > On Tue, May 08, 2012 at 10:15:00AM -0700, Ali Çehreli wrote: > > > On 05/08/2012 10:11 AM, H. S. Teoh wrote: > > > >I have some code along these lines: > > > > struct S { > >

Re: Behaviour of alias this changed

2012-05-08 Thread Jonathan M Davis
On Tuesday, May 08, 2012 10:57:20 H. S. Teoh wrote: > On Tue, May 08, 2012 at 01:52:14PM -0400, Jonathan M Davis wrote: > > On Tuesday, May 08, 2012 10:30:53 H. S. Teoh wrote: > > > On Tue, May 08, 2012 at 10:15:00AM -0700, Ali Çehreli wrote: > > > > On 05/08/2012 10:11 AM, H. S. Teoh wrote: > > >

Re: Behaviour of alias this changed

2012-05-08 Thread kenji hara
2012/5/9 H. S. Teoh : > I have some code along these lines: > >        struct S { >                short[4] data; >                alias this data; > >                string toString() { ... } >        } >        ... >        S s; >        writeln(to!string(s)); > > In dmd 2.059 (I believe) and ear

Re: Behaviour of alias this changed

2012-05-10 Thread H. S. Teoh
On Wed, May 09, 2012 at 02:10:37PM +0900, kenji hara wrote: > 2012/5/9 H. S. Teoh : > > I have some code along these lines: > > > >        struct S { > >                short[4] data; > >                alias this data; > > > >                string toString() { ... } > >        } > >        ... >