dmd 1.054 and 2.038 release

Walter Bright newshound1 at digitalmars.com
Thu Dec 31 13:20:08 PST 2009


Steven Schveighoffer wrote:
>>(I'm assuming bug 1961('scoped const') is considered to be 
>> fixed).
> 
> Sadly, it's not fixed yet :(
> 
> 
> struct S
> {
>     int x;
>     inout(int)* getX() inout { return &x;}
> }
> 
> void main()
> {
>     S s;
>     int *x = s.getX();
> }
> 
> 
> testinout.d(10): Error: function testinout.S.getX () inout is not 
> callable using argument types ()
> testinout.d(10): Error: cannot implicitly convert expression (s.getX()) 
> of type inout(int)* to int*
> 
> It appears the auto-conversion is not happening on the return, and also 
> the call isn't working.

The inout on the return has to be at the top level, as in inout(int *). 
This probably needs improvement.


More information about the Digitalmars-d-announce mailing list