Two cases showing imperfection of the const system

Timon Gehr timon.gehr at gmx.ch
Thu Feb 16 16:34:41 PST 2012


On 02/17/2012 01:19 AM, SiegeLord wrote:
>> It does. The problem is that your function is missing a return statement.
>
> Try it with the return statement, it doesn't compile anyway.
>
> -SiegeLord
>
>

This compiles with DMD 2.057 and DMD 2.058:

import std.stdio;
inout(char)[] test(inout(char)[] x){
     inout(char)[][int] a;
     a[1]=x;
     return a[1];
}

void main(){
     writeln(test(['a']));
}


More information about the Digitalmars-d mailing list