[Issue 3273] struct invariant + dtor fails to compile (no line number)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 15 13:23:29 PDT 2010


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



--- Comment #2 from Don <clugdbug at yahoo.com.au> 2010-06-15 13:23:27 PDT ---
There's a few different issues involved in this.
(1) The result variable isn't mutable.
Generated opAssign will return a const(A), because the result variable is
in func.c 1114:
                if (!isVirtual())
                    v->storage_class |= STCconst;

because opAssign is not virtual. This line of code was added in svn 259 as part
of the fix for bug 3390 (out(result) contract should not be able to rebind
result). I think this line of code is wrong.

(2) The result variable isn't an lvalue.
This is the bug which was introduced in 2.031.

(3) invariant + dtor + a non-void function with this struct as parameter, has
never worked.
For example this code fails on 2.022 with "cannot goto forward into different
try block level". It's never worked.

struct A {
    invariant() {   }
    ~this() { }
    int blah(A a) { return 0; }
    void opAssign(A a) {}
}

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