Possible bug with ? : and const

zildjohn01 how at are.you
Thu Mar 5 14:03:00 PST 2009

I've boiled it down to this:

bool flag() {
	bool left, right;
	return true ? cast(const bool)left : cast(bool)right;

Error: cannot implicitly convert expression (cast(int)left) of type int to bool

It seems like whenever the left and right sides differ in const-ness or invariant-ness, dmd tries to convert the left side to an int. Can anyone confirm or explain?

More information about the Digitalmars-d mailing list