www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4993] New: Temporary values and opIndexAssign

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

           Summary: Temporary values and opIndexAssign
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: simen.kjaras gmail.com



PDT ---
The following code does not compile. Note that the exact same functions are
present in both the inner and outer structs, and that opIndex works for both.

struct Foo{
    struct Bar {
        int opIndex( size_t index ) {
            return 3;
        }

        void opIndexAssign( int value, size_t index ) {
        }
    }
     property
    auto bar( ) {
        return Bar( );
    }

    int opIndex( size_t index ) {
        return 3;
    }

    void opIndexAssign( int value, size_t index ) {
    }
}

void main( ) {
    Foo f;
    f[3] = f[2];
    Foo.Bar b;
    b[3] = b[2];
    f.bar[3] = f.bar[2]; // Fails
}


foo.d(28): Error: f.bar()[3u] is not an lvalue

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 04 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4993


Nils <mailme+d nilsb.dyndns.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsimcha yahoo.com



*** Issue 5202 has been marked as a duplicate of this issue. ***

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


Nils <mailme+d nilsb.dyndns.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |mailme+d nilsb.dyndns.org



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

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





 https://github.com/D-Programming-Language/dmd/pull/791
That one has been superseded by https://github.com/D-Programming-Language/dmd/pull/763 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 07 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4993


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 17 2012