digitalmars.D - Possible bug with ? : and const
- zildjohn01 <how are.you> Mar 05 2009
- Someone Else <or possibly.not> Mar 06 2009
- "Denis Koroskin" <2korden gmail.com> Mar 06 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?
Mar 05 2009
zildjohn01 Wrote:some code
Please don't be so quick to shove me off the first page. At least drop it in dmd real quick and confirm this. Or tell me i'm dead wrong, that'd be cool too. Should I skip the forums and file the bug?
Mar 06 2009
On Fri, 06 Mar 2009 20:14:34 +0300, Someone Else <or possibly.not> wrote:zildjohn01 Wrote:some code
Please don't be so quick to shove me off the first page. At least drop it in dmd real quick and confirm this. Or tell me i'm dead wrong, that'd be cool too. Should I skip the forums and file the bug?
Yes, I believe it is a bug and needs to be reported via bugzilla: http://d.puremagic.com/issues/
Mar 06 2009








"Denis Koroskin" <2korden gmail.com>