<div>import std.array;</div><div><br></div><div>void main(){</div><div> //enum a1=[1].array;//NG: Error: gc_malloc cannot be interpreted at compile time</div><div> enum a2=" ".array;//OK</div><div><br></div><div>
import std.string;</div><div> //enum a3=" ".splitLines.array;//NG</div><div> enum a4="".splitLines.array;//OK</div><div> enum a5=" ".split.array;//OK</div><div> //enum a6=" a ".split.array;//NG</div>
<div> import std.algorithm:filter;</div><div> enum a7=" a ".split.filter!(a=>true).array;</div><div> auto a8=" a ".split.array;</div><div> assert(a8==a7);</div><div> enum a9=[1].filter!(a=>true).array;//OK</div>
<div>}</div><div><br></div><div><br></div><div>I don't understand why the NG above fail (with Error: gc_malloc cannot be interpreted at compile time)</div><div><br></div><div>furthermore, it seems we can bypass the CT error with interleaving filter!(a=>true) (see above), which is even weirder.</div>