www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4345] New: std.range.take!string: "Nonsensical finite range with slicing but no length"

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

           Summary: std.range.take!string: "Nonsensical finite range with
                    slicing but no length"
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: michel.fortin michelf.com


--- Comment #0 from Michel Fortin <michel.fortin michelf.com> 2010-06-19
08:39:44 EDT ---
This code triggers a static assert called "Nonsensical finite range with
slicing but no length" in std.range.take!string:

    string str = "abcdef";
    string result = str.take(3);
    assert(array(result) == "abc");

It probably has something to do with strings which have no length defined to so
they work with code units instead of code points.

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


David Simcha <dsimcha yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dsimcha yahoo.com
         Resolution|                            |FIXED


--- Comment #1 from David Simcha <dsimcha yahoo.com> 2010-08-16 16:51:03 PDT ---
Fixed SVN.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 16 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4345


bearophile_hugs eml.cc changed:

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


--- Comment #2 from bearophile_hugs eml.cc 2010-08-16 16:52:08 PDT ---
David, are you trying to fix all Phobos by yourself? Leave some work to the
others, please ;-)

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