[Issue 11244] Invalid warning about slice assignment

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 14 15:17:20 PDT 2013


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


Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com


--- Comment #4 from Walter Bright <bugzilla at digitalmars.com> 2013-10-14 15:17:19 PDT ---
The repro case:
-------------------------
struct SimpleWrapper
{
    int[] m_data;

    this(int[] data)
    {
        m_data = data;
    }

    ref int[] opSlice()
    {
        return m_data;
    }
}

void main(string[] args)
{
    auto s = SimpleWrapper([1, 2, 3, 4]);
    auto copy = new int[4];
    copy[] = s[];
}

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