http://d.puremagic.com/issues/show_bug.cgi?id=6374
Summary: [CTFE] Cannot subscript using pointer to array Product: D Version: D2 Platform: Other OS/Version: Mac OS X Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: kenn...@gmail.com --- Comment #0 from kenn...@gmail.com 2011-07-24 14:05:05 PDT --- Test case: --------------------- static assert({ int[] arr = [1]; arr.ptr[0] = 2; // <-- line 3 return arr[0]; }() == 2); --------------------- y.d(3): Error: cannot determine length of cast(int*)arr at compile time y.d(5): Error: cannot evaluate delegate pure nothrow int() { int[] arr = [1]; (cast(int*)arr)[0u] = 2; return arr[0u]; } () at compile time y.d(1): Error: static assert (delegate pure nothrow int() { int[] arr = [1]; (cast(int*)arr)[0u] = 2; return arr[0u]; } () == 2) is not evaluatable at compile time --------------------- Slicing is OK, though. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------