enum Fruit(T) : T { apple, banana = -42 }
void main() { auto shortFruit = Fruit!(short).apple; auto longFruit = Fruit!(long).banana; longFruit = shortFruit; // OK: implicit conversion allowed shortFruit = longFruit; // OK: ... even a truncating one Fruit!uint uintFruit; // Error: -42 is out of range of uint Fruit!string stringFruit; // Error: enums need initializers }