[Issue 9454] Struct invariant call on whole-struct assignements?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 6 03:19:32 PST 2013


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



--- Comment #1 from bearophile_hugs at eml.cc 2013-02-06 03:19:30 PST ---
Discussion thread:
http://forum.dlang.org/thread/vqoyehpcepobnzyolzfc@forum.dlang.org

This is a similar issue:
http://d.puremagic.com/issues/show_bug.cgi?id=519


They are very similar, the test case from Issue 519 uses a new:


class Foo {
    invariant() {
        assert (false);
    }
}
void main() {
    Foo foo = new Foo();
}


While in Issue 9454 (just like in that Ada code) there is no new:


struct Foo {
    int x = 200;
    invariant() { assert(x > 100); }
}
void main() {
    auto f = Foo(10);
}

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