www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7097] New: opDollar doesn't work with slicing

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

           Summary: opDollar doesn't work with slicing
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com


--- Comment #0 from David Simcha <dsimcha yahoo.com> 2011-12-11 09:24:42 PST ---
struct S {
     property size_t length() const {
        return 1;
    }

    S opSlice(size_t lower, size_t upper) { assert(0); }

    alias length opDollar;
}

void main() {
    S s;
    auto num = s[0..$];
}

test9.d(13): Error: undefined identifier __dollar

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


dawg dawgfoto.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dawg dawgfoto.de


--- Comment #1 from dawg dawgfoto.de 2012-05-28 01:32:14 PDT ---
https://github.com/D-Programming-Language/dmd/pull/577

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



--- Comment #2 from github-bugzilla puremagic.com 2012-10-28 18:15:14 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/a88decb8a85efe2e9b59abb7e1fce752051dcdd6
Merge pull request #577 from dawgfoto/Bug7097

fix Issue 7097 - opDollar doesn't work with slicing

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


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc


--- Comment #3 from bearophile_hugs eml.cc 2012-10-28 19:03:08 PDT ---
This is crashing dmd, do you want me to open a new bug report?


static struct Foo {
    int[] opSlice(int a, int b) {
        return [a, b];
    }
    int opDollar(int dim)() {
        return dim;
    }
}
void main() {
    Foo array;
    array[0 .. $];
}



Assertion failure: 'd' on line 1401 in file 'dsymbol.c'

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



--- Comment #6 from github-bugzilla puremagic.com 2012-10-28 22:24:41 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/2769221119945bff9afce0dd171b71d43b49427b
Merge pull request #1233 from dawgfoto/fixupBug7097

fixup of pull #577

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