[Issue 11238] Codegen error when this is a ref parameter to the method

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 12 18:06:39 PDT 2013


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


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-10-12 18:06:38 PDT ---
Reduced, I think this bug is unrelated to ref'ness:

-----
import std.algorithm;
import std.stdio;

void main()
{
    int[2] arr;

    arr[0] = 1;
    arr[1] = 2;

    writeln(arr);

    arr = [arr[1], arr[0]];
    // swap(arr[1], arr[0]);  // workaround

    writeln(arr);
}
-----

$ dmd -run test.d
> [1, 2]
> [2, 2]

Versions older than 2.063 don't seem to have this issue.

-- 
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