[Issue 6930] combined type of immutable(T) and inout(T) should be inout(const(T))

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 10 12:00:15 PST 2011


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



--- Comment #5 from Kenji Hara <k.hara.pg at gmail.com> 2011-11-10 11:59:36 PST ---
(In reply to comment #0)
> 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)

I think that the reason why this code works is bug 6922, not bug 6912.
Because bug 6922 parses inout(const(int[])) as inout(int[]).

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


More information about the Digitalmars-d-bugs mailing list