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 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?

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 LDC

Question about linker errors when using slices

2020-09-18 Thread tspike via Digitalmars-d-learn
I’ve been using D for personal projects for almost a year now and I really love it. I recently ran across a linker error that I’m a little confused by. Consider the following files: platform.d: module platform; import app; struct PlatformData { AppData a; } v