On Monday, 24 June 2013 at 05:31:29 UTC, Ali Çehreli wrote:
On 06/23/2013 10:07 PM, Ali Çehreli wrote:

> I think it is a compiler bug.

Make that a Phobos bug. :)

The following is a reduced program that exhibits the problem. The presence or absence of the unused member function makes a difference:

import std.typecons;

struct S
{
    int x;

// Bizarre: Comment-out this function to pass the assert in main.
    Tuple!(S) unused()
    {
        return tuple(S(7));
    }
}

void main()
{
    auto s = S(8);

    assert(tuple(s).expand[0] == S(8));
}

Ali

Actually I hadn't tried with free functions, but this test captures my problem. I'll file it now. Thanks!

Reply via email to