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

--- Comment #0 from Roman D. Boiko <> 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];

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:
------- You are receiving this mail because: -------

Reply via email to