Summary: assert does not call "invariant()" function
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD

--- Comment #0 from 2012-10-09 01:19:41 PDT ---
According to

"The invariant can be checked when a class object is the argument to an
assert() expression, as: "

Date mydate;
assert(mydate); // check that class Date invariant holds

But I get:

struct S

void main()
    S s;
Error: expression s of type S does not have a boolean value

IMO, behavior of assert should be:
1. Check for argument can be cast to bool. If yes, do it. The call should
trigger invariant check anyways.
2. Else, call invariant directly.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to