Re: CTFE in imported static initializers

2019-05-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/14/19 10:41 PM, Steven Schveighoffer wrote: OK, now that I have a compiler developer agreeing, I feel more comfortable filing ;) https://issues.dlang.org/show_bug.cgi?id=19874 -Steve

Re: CTFE in imported static initializers

2019-05-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/14/19 8:06 PM, kinke wrote: On Tuesday, 14 May 2019 at 10:21:23 UTC, Steven Schveighoffer wrote: I too am out of my league when it comes to what's valid here ;) Valid or not, 1 second is ridiculous, please file a bug. For an importing module, it's just an external TLS global. As you ment

Re: CTFE in imported static initializers

2019-05-14 Thread kinke via Digitalmars-d-learn
On Tuesday, 14 May 2019 at 10:21:23 UTC, Steven Schveighoffer wrote: I too am out of my league when it comes to what's valid here ;) Valid or not, 1 second is ridiculous, please file a bug. For an importing module, it's just an external TLS global. As you mentioned, type inference shouldn't n

Re: CTFE in imported static initializers

2019-05-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/13/19 9:39 PM, Steven Schveighoffer wrote: I have just discovered an interesting behavior, and I'm wondering if this behavior is intentional or even necessary. Let's say I have this module called mod2.d: module mod2; string buildModData() {     string result;     foreach(i; 0 .. 1)

Re: CTFE in imported static initializers

2019-05-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/14/19 10:25 AM, Bastiaan Veelo wrote: On Monday, 13 May 2019 at 20:39:57 UTC, Steven Schveighoffer wrote: Why? I can't even use it at compile time... pragma(msg, moddata.length); Is that a good test or "usable at compile time", though? Isn't pragma(msg) done at an earlier stage than CTF

Re: CTFE in imported static initializers

2019-05-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/14/19 10:30 AM, Stefan Koch wrote: On Tuesday, 14 May 2019 at 08:26:41 UTC, Steven Schveighoffer wrote: On 5/13/19 9:39 PM, Steven Schveighoffer wrote: Does anyone have a good answer for why this should happen, or should I file a bug? It's been mentioned to me that type inference is us

Re: CTFE in imported static initializers

2019-05-14 Thread Stefan Koch via Digitalmars-d-learn
On Tuesday, 14 May 2019 at 08:26:41 UTC, Steven Schveighoffer wrote: On 5/13/19 9:39 PM, Steven Schveighoffer wrote: Does anyone have a good answer for why this should happen, or should I file a bug? It's been mentioned to me that type inference is used here. However, one could argue that t

Re: CTFE in imported static initializers

2019-05-14 Thread Bastiaan Veelo via Digitalmars-d-learn
On Monday, 13 May 2019 at 20:39:57 UTC, Steven Schveighoffer wrote: Why? I can't even use it at compile time... pragma(msg, moddata.length); Is that a good test or "usable at compile time", though? Isn't pragma(msg) done at an earlier stage than CTFE? I think that was the argument for ctfeWr

Re: CTFE in imported static initializers

2019-05-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/13/19 9:39 PM, Steven Schveighoffer wrote: Does anyone have a good answer for why this should happen, or should I file a bug? It's been mentioned to me that type inference is used here. However, one could argue that the CTFE doesn't need to complete in order to infer the type, the func