[Issue 5284] New: Array ops punch through const system

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 28 09:01:37 PST 2010


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

           Summary: Array ops punch through const system
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dfj1esp02 at sneakemail.com
            Blocks: 2573


--- Comment #0 from Sobirari Muhomori <dfj1esp02 at sneakemail.com> 2010-11-28 09:00:08 PST ---
---
class A { int m=5; }

int main()
{
    A[] a=new A[1];
    immutable(A)[] b=[new immutable(A)];
    assert(b[0].m==5);
    a[]=b[]; //should not pass typecheck
    a[0].m=10;
    assert(b[0].m==5,"fail"); //line 18
    return 0;
}
---
>dmd -w -debug -run test.d
---
core.exception.AssertError at test.d(18): fail

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