[Issue 519] New: Invariant not called from autogenerated constructor
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 15 05:34:27 PST 2006
http://d.puremagic.com/issues/show_bug.cgi?id=519
Summary: Invariant not called from autogenerated constructor
Product: D
Version: 0.174
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: wrong-code
Severity: major
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: deewiant at gmail.com
This code should fail regardless of whether the constructor is commented out or
not:
class Foo {
// this() {}
invariant {
assert (false);
}
}
void main() {
Foo foo = new Foo();
}
Yet, it only does if the constructor is explicitly specified. The invariant is
not called from the automatically inserted constructor, even though there's no
reason why it shouldn't be.
--
More information about the Digitalmars-d-bugs
mailing list