| Thread overview | |||||
|---|---|---|---|---|---|
|
March 05, 2009 Possible bug with ? : and const | ||||
|---|---|---|---|---|
| ||||
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?
| ||||
March 06, 2009 Re: Possible bug with ? : and const | ||||
|---|---|---|---|---|
| ||||
Posted in reply to zildjohn01 | 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?
| |||
March 06, 2009 Re: Possible bug with ? : and const | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Someone Else | 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/ | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply