[Issue 7401] Pure contracts Unnecessarily strict

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 30 14:55:10 PST 2012


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



--- Comment #2 from Era Scarecrow <rtcvb32 at yahoo.com> 2012-01-30 14:55:06 PST ---
(In reply to comment #1)
> See also issue 7224  (that asks kind of the opposite)

 In his remark, it seems rather silly. Of course it won't raise an exception
when it's in release mode, the in contract won't even be present.



 However with the pure contract, I don't want to have to encompass a debug{}
block to show my assert details. Then I need the -debug flag on as well
otherwise it won't be checked, unless you go around it...

in {
  string message = "use -debug or pure gets in the way";
  debug {
    message = to!string();
  }

  assert(something, x);
}

or

in {
  debug {
    assert(something, "with message");
  }
  assert(something); //same assert as above but doesn't give a useful message.
}

-- 
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