[Issue 10939] New: Inconsistent stripping of "in" but not assert in release/unittest
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Sep 1 01:07:06 PDT 2013
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 at puremagic.com
ReportedBy: monarchdodra at gmail.com
--- Comment #0 from monarchdodra at gmail.com 2013-09-01 01:07:05 PDT ---
//----
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: -------
More information about the Digitalmars-d-bugs
mailing list