On Monday, 26 November 2012 at 12:32:08 UTC, Manu wrote:
1.enum i = 10;pragma(msg, is(i == enum) || is(typeof(i) == enum)); // <- false?!I can't find a way to identify that i is an enum, not a variable; can notbe assigned, has no address, etc.
Because 'i' is not an enum, it's actually a manifest constant. Unless you specify an enum name, no new type is created. http://dlang.org/enum.html
Compare:
enum E {
i = 10
}
pragma(msg, is(typeof(E.i) == enum));
