[Issue 6588] Struct d'tors + immutable elements doesn't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 10 17:04:44 PST 2012


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


Marco Leise <Marco.Leise at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Marco.Leise at gmx.de


--- Comment #3 from Marco Leise <Marco.Leise at gmx.de> 2012-11-10 17:04:42 PST ---
(In reply to comment #1)

Thanks I think in my case I can then implement opAssign to skip the assignment
of immutable fields. Here is a real short test case without templates:

struct Bug6588 {
  immutable int x;
  ~this() {}
}

Also this is related:

struct Bug6588 {
  immutable int x;
  ref Bug6588 test() { return this; }  // this is not mutable
  ref const(Bug6588) test() { return this; }  // ok
}

The compiler has a hard time with partial const/immutable structures.

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