www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5397] New: Compiler error on struct with invariant and postblitz

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5397

           Summary: Compiler error on struct with invariant and postblitz
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: alex.khmara gmail.com


--- Comment #0 from Alex Khmara <alex.khmara gmail.com> 2011-01-01 13:12:38 PST
---
This code:

module properties;

struct PropertyList {
    invariant() {
       assert(1);
    }

    this(this) {
        _props = [];
    }

    string[] _props;
}


gives compiler error:

Error: __result = this is not mutable
Error: __result = this is not an lvalue

Without invariant all works good.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 01 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5397


Alex Khmara <alex.khmara gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|Other                       |x86


--- Comment #1 from Alex Khmara <alex.khmara gmail.com> 2011-01-01 13:14:12 PST
---
It seems that I cannot set proper DMD version - It was on DMD 2.0.51, Linux x86

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 01 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5397


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |DUPLICATE


--- Comment #2 from Don <clugdbug yahoo.com.au> 2011-01-01 22:26:12 PST ---
(In reply to comment #1)
 It seems that I cannot set proper DMD version - It was on DMD 2.0.51, Linux x86
You should just set version = D2 (the exact release number is useless information). Same issue as bug 3273. *** This issue has been marked as a duplicate of issue 3273 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 01 2011