Hello,
My code:
import std.string : join;
enum Key : string
{
First = "qwerty",
Last = "zaqy"
}
struct Qaz
{
enum text(alias Values) = Values.map!(value => "bool has" ~
value ~ " = false;").join();
}
//enum text(alias Values) = Values.map!(value => "bool has" ~
value ~ " = false;").join();
void main()
{
pragma(msg, Qaz.text!([Key.First, Key.Last]));
}
During compilation I get:
/dlang/dmd/linux/bin64/../../src/phobos/std/algorithm/iteration.d(475): Error:
this.__lambda2 has no value
onlineapp.d(33): Error: template instance
`onlineapp.Qaz.text!(["qwerty", "zaqy"])` error instantiating
onlineapp.d(33): while evaluating pragma(msg,
(Qaz).text!(["qwerty", "zaqy"]))
If I uncomment that line and use
pragma(msg, text!([Key.First, Key.Last]));
then compilation is passed.
What happens?