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

           Summary: Cannot access front of array with immutable elements
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: r...@d-coding.com


--- Comment #0 from Roman D. Boiko <r...@d-coding.com> 2012-06-25 09:04:47 PDT 
---
import std.range;
struct Element {
  //immutable // uncomment to break compilation
   int _i;
  this(int i) { _i = i; }
}
void main() {
  auto arr = [Element.init];
  arr.front;
}

Declaring _i as immutable yields the following compilation error:

/usr/include/x86_64-linux-gnu/dmd/phobos/std/array.d(460): Error: 
a[0LU] isn't mutable
sample.d(11): Error: template instance std.array.front!(Element) 
error instantiating

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to