Re: static foreach over constant range in @nogc block

2020-10-03 Thread tspike via Digitalmars-d-learn
On Saturday, 3 October 2020 at 14:19:27 UTC, Paul Backus wrote: On Saturday, 3 October 2020 at 14:17:45 UTC, tspike wrote: On Saturday, 3 October 2020 at 14:12:21 UTC, Paul Backus wrote: https://issues.dlang.org/show_bug.cgi?id=18439 Perfect! Thanks for getting back to me so quickly. FYI I

Re: static foreach over constant range in @nogc block

2020-10-03 Thread tspike via Digitalmars-d-learn
On Saturday, 3 October 2020 at 14:12:21 UTC, Paul Backus wrote: https://issues.dlang.org/show_bug.cgi?id=18439 Perfect! Thanks for getting back to me so quickly.

Re: static foreach over constant range in @nogc block

2020-10-03 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 3 October 2020 at 14:17:45 UTC, tspike wrote: On Saturday, 3 October 2020 at 14:12:21 UTC, Paul Backus wrote: https://issues.dlang.org/show_bug.cgi?id=18439 Perfect! Thanks for getting back to me so quickly. FYI I am not Timon Gehr, the person who originally replied to you,

Re: static foreach over constant range in @nogc block

2020-10-03 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 3 October 2020 at 14:02:08 UTC, tspike wrote: On Saturday, 3 October 2020 at 12:43:01 UTC, Timon Gehr wrote: It's a compiler bug, the same as this one: @nogc: void main(){ static immutable x = { int[] a; a~=1; return a; }(); } Ah, thank you for the quick reply! Do you know

Re: static foreach over constant range in @nogc block

2020-10-03 Thread tspike via Digitalmars-d-learn
On Saturday, 3 October 2020 at 12:43:01 UTC, Timon Gehr wrote: It's a compiler bug, the same as this one: @nogc: void main(){ static immutable x = { int[] a; a~=1; return a; }(); } Ah, thank you for the quick reply! Do you know if this bug has already been reported?

Re: static foreach over constant range in @nogc block

2020-10-03 Thread Timon Gehr via Digitalmars-d-learn
On 03.10.20 13:18, tspike wrote: I came across an issue recently that I’m a little confused by. The following program fails to compile under LDC and DMD, though it compiles fine under GDC:     @nogc:     void main()     {     static foreach(i; 0 .. 4)     {    

static foreach over constant range in @nogc block

2020-10-03 Thread tspike via Digitalmars-d-learn
I came across an issue recently that I’m a little confused by. The following program fails to compile under LDC and DMD, though it compiles fine under GDC: @nogc: void main() { static foreach(i; 0 .. 4) { pragma(msg, i); } } Both DMD and