Sergey Gromov schrieb:
 > class Cls
{
  int bar;
  char[] baz;
}
string foo()
{
  auto members = __traits(allMembers, Cls);
  return "";
}
pragma(msg, foo());

dmd -c test.d
test.d(11): Error: cannot evaluate foo() at compile time
test.d(11): pragma msg string expected for message, not 'foo()'

Comment out the traits and it compiles.  Traits are supposed to be
compile-time.  How's that possible for them to prevent compile-time
evaluation?

Seeing this really simple example crashing makes me think that this has to be a bug.

Reply via email to