[Issue 7922] alias this causes weird formatting issues for strings

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 16 23:48:20 PDT 2012


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


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, wrong-code
           Severity|normal                      |regression


--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2012-04-16 23:49:12 PDT ---
This is a regression of fixing bug 7583.

Reduced test case:
----
struct S
{
    int[] arr;
    alias arr this;
}
S func(...)
{
    S ret;
    ret.arr.length = _arguments.length;
    return ret;
}
void main()
{
    int[] arr;
    assert(arr.length == 0);
    arr ~= func(1, 2);  //NG
    //arr = func(1, 2); //OK
    assert(arr.length == 2);
}

Pull request:
https://github.com/D-Programming-Language/dmd/pull/885

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