www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6259] New: Property getters returning ref const() cause setters to be hidden

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

           Summary: Property getters returning ref const() cause setters
                    to be hidden
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: ludwig informatik.uni-luebeck.de



12:41:23 PDT ---
The following source will produce the following error on DMD 2.054beta:

bug1.d(10): Error: s.prop is not mutable

---
struct S {
    private int m_prop;
    ref const(int) prop() { return m_prop; }
    void prop(int v) { m_prop = v; } 
}

void test()
{
    S s;
    s.prop = 1;
}
---

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




12:47:30 PDT ---
Just noticed that the difference to DMD 2.053 and prev. is that the ref const()
getter was not matched for assignments but is now. Declaring the property
setter first makes the code compile again, which seems wrong, as there should
be no reason for the declaration order to matter.

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


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch, rejects-valid
                 CC|                            |yebblies gmail.com
           Platform|Other                       |All
            Version|unspecified                 |D2
            Summary|Property getters returning  |Regression(2.054 beta):
                   |ref const() cause setters   |Property getters returning
                   |to be hidden                |ref const() cause setters
                   |                            |to be hidden
         OS/Version|Windows                     |All



https://github.com/D-Programming-Language/dmd/pull/241

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


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |braddr puremagic.com
         Resolution|                            |DUPLICATE



---
*** This issue has been marked as a duplicate of issue 6398 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 03 2011