[Issue 5868] static attribute ignored with public static {} blocks

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 26 17:44:25 PST 2012


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



--- Comment #7 from hsteoh at quickfur.ath.cx 2012-01-26 17:44:20 PST ---
There's nothing technically wrong with it, but it's misleading. When you write:

class A {
    int x;
    this(int) { ... }

    static {
        int y;
        this(uint) { ... }
    }
}

It appears as though the second ctor is somehow "static" in some sense, yet it
is not, as the current semantics mean that you can hoist it out of the static
block and still retain the same meaning. Since that's the case, why not
prohibit it from being placed in a static block in the first place?

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