www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10939] New: Inconsistent stripping of "in" but not assert in release/unittest

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

           Summary: Inconsistent stripping of "in" but not assert in
                    release/unittest
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: monarchdodra gmail.com



//----
import core.exception;

void main()
in
{
    assert(0); //Passes
}
body
{
    int i = 0;
    assert(i != 0); //Error
    version (assert) throw new RangeError(); //Error too
}
//----

When run with "-unittest -release", then the "in" block is stripped out, but
the asserts aren't. This is inconsistent. The "in" block should also remain.

Also, *Arguably*, I think the version (assert) blocks should be stripped
though: These can contain any kind of code, which does *more* than just tests
(it can set pointers to 0, log things, deep deconstruct stuff, you name it),
which we probably *specifically* don't want to run, since we are in a "release
unittest".

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