https://issues.dlang.org/show_bug.cgi?id=19928

Andrei Alexandrescu <and...@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |and...@erdani.com

--- Comment #2 from Andrei Alexandrescu <and...@erdani.com> ---
This does seem to be a problem. This is liable to cause problems:

import std.stdio : writeln;

struct A
{
    immutable int x;
    this(int)
    {
        foo();
        x = 8;
        foo();
    }

    void foo()
    {   
        passToAnotherThread(&x);
    }       
}

The observing thread assumes the immutable(int)* it receives is, well,
immutable. In reality that value will change over time.

--

Reply via email to