Great. So is it a known bug?<br><br><div class="gmail_quote">On Mon, Sep 12, 2011 at 10:35 PM, Jonathan M Davis <span dir="ltr"><<a href="mailto:jmdavisProg@gmx.com">jmdavisProg@gmx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Monday, September 12, 2011 22:31:33 Caligo wrote:<br>
> Trying to help someone on SO, I ran into problems.<br>
><br>
> On a 64-bit Linux machine, with DMD 2.055<br>
><br>
> This gives: '/Internal error: ../ztc/cg87.c 202'<br>
> void main(){<br>
><br>
> auto f = (double m){ static double sum = 0.0; return sum += m * m; };<br>
> double[] a = array(map!f(iota(1.0, 25.0, 1.0)));<br>
> writeln(a);<br>
> }<br>
><br>
><br>
> This one compiles but I get Segmentation fault.<br>
> void main(){<br>
><br>
> auto f = (double m){ /* static double sum = 0.0;*/ return m * m; };<br>
> double[] a = array(map!f(iota(1.0, 25.0, 1.0)));<br>
> writeln(a);<br>
> }<br>
><br>
><br>
> This one compiles and runs.<br>
> void main(){<br>
><br>
> auto f = (double m){ /* static double sum = 0.0;*/ return m * m; };<br>
> double[] a = array(map!f(array(iota(1.0, 25.0, 1.0))));<br>
> writeln(a);<br>
> //works<br>
> }<br>
><br>
><br>
> Putting everything together, I still get 'Internal error: ../ztc/cg87.c 202'<br>
> with this one.<br>
> void main(){<br>
><br>
> auto f = (double m){ static double sum = 0.0; return sum += m * m; };<br>
> double[] a = array(map!f(array(iota(1.0, 25.0, 1.0))));<br>
> writeln(a);<br>
> }<br>
<br>
</div></div>It's always a bug if you see "Internal error."<br>
<font color="#888888"><br>
- Jonathan M Davis<br>
</font></blockquote></div><br>