http://d.puremagic.com/issues/show_bug.cgi?id=6930

           Summary: combined type of immutable(T) and inout(T) should be
                    inout(const(T))
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2011-11-10 11:00:59 PST ---
The combined type of immutable(T) and inout(T) should be inout(const(T)).

For example:

inout(const(int[])) foo(inout(int[]) x){
    import std.random;
    bool condition = cast(bool)uniform(0,2);
    return condition ? x : new immutable(int[])(2);
}

(currently this code is still accepted because of issue 6912, but as soon as it
is fixed this won't work anymore)

DMD 2.056 says that the combined type of immutable(T) and inout(T) is const(T),
but that is losing information.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to