This file causes a compile error:
```
struct S {
immutable int[] xs;
this(immutable int[] xs_) {
xs = xs_;
foreach (ref immutable int x; xs) {}
}
}
```
The error is:
```
$ dmd a.d
a.d(5): Error: immutable field `xs` initialized multiple times
a.d(4): Previous initialization is here.
```
This isn't right because iterating over `xs` should count as reading it, not as initializing it.
Tested with dmd v2.098.0.
Comment #1 by robert.schadek — 2024-12-13T19:19:47Z