[dmd-beta] Fighting with 2.059 and not quite winning

Walter Bright walter at digitalmars.com
Sun Apr 8 21:14:32 PDT 2012



On 4/8/2012 8:58 PM, Vladimir Panteleev wrote:
>
> I have hit another problem:
>
> import std.algorithm;
>
> struct S
> {
>     int n;
>
>     string toString()
>     {
>         return null;
>     }
> }
>
>
> void main()
> {
>     S*[] all;
>     sort!q{a.n > b.n}(all);
> }
>
> Compiling the above program prints a wall of error messages.
>
> I don't think this is related to the pure/nothrow. Seems to be an unrelated 
> regression from 2.058.
>

It has nothing to do with toString. The following fails in the same way:

import std.algorithm;

struct S
{
     int n;
}


void main()
{
     S[] all;
     sort!q{a.n > b.n}(all);
}



More information about the dmd-beta mailing list