[Issue 1626] bool spec problem

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 29 18:16:20 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1626


davidl at 126.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




------- Comment #2 from davidl at 126.com  2007-10-29 20:16 -------
I think you miss the point
if( 3 ) 
{
}
works
And in the spec:
"Expression is evaluated and must have a type that can be converted to a
boolean. If it's true the ThenStatement is transferred to"

Notice: If it's *true* the ThenStatement is transferred to
So what's *true*? I would think the evaluated result of the specific
expression.
And what type can have value *true*? bool is the answer.

Therefore, the expression is not only a type that *can* be converted to a
boolean, but also a type already be converted to a boolean. So the convertion
here is implicitly.


-- 



More information about the Digitalmars-d-bugs mailing list