[Issue 1626] bool spec problem

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 2 07:38:16 PDT 2009


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


Christian Kamm <kamm-removethis at incasoftware.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |kamm-removethis at incasoftwar
                   |                            |e.de




--- Comment #4 from Christian Kamm <kamm-removethis at incasoftware.de>  2009-07-02 07:38:15 PDT ---
Something like this could be added to Statements/If Statement to make the spec
describe DMD's behavior:

If the condition expression v that is passed to the if statement is not of type
bool, a different expression depending on v's type is evaluated instead:
 * integer, floating point, complex, pointer, function: v != 0
 * array: v.ptr != 0
 * associative array: cast(void*)v != 0
 * delegate: v.funcptr != 0
 * class: v !is null
 * struct: error

Note that for struct and class type conditions, it is not equivalent to
evaluating cast(bool)v.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list