CTFE in imported static initializers
    Steven Schveighoffer 
    schveiguy at gmail.com
       
    Tue May 14 10:17:56 UTC 2019
    
    
  
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 used here. However, 
>> one could argue that the CTFE doesn't need to complete in order to 
>> infer the type, the function is not a template or auto function.
>>
>> In addition, if I change the declaration to:
>>
>> static string moddata = ...;
>>
>> It still takes 1 second to compile mod1.
>>
> 
> try changing it to static immutable.
Still 1 second.
-Steve
    
    
More information about the Digitalmars-d-learn
mailing list