Three legitimate bugs? (D1.061)

bearophile bearophileHUGS at lycos.com
Mon May 17 12:31:23 PDT 2010


Steven Schveighoffer:

> Unlike some languages, D1 const does not imply static.  Which means you
> are trying to define an S as containing an S, which would then contain
> another S and so on.

It seems the const implies static, in structs... I don't know if this is by design, or it's a compiler bug, or something. I don't understand. This doesn't asserts:

struct Foo {
    float value;
    const Foo f = Foo();
}
void main() {
    assert(Foo.sizeof == 4);
}


This looks like a compiler bug that I can add it to bugzilla.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list