www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20783] New: std.string.lastIndexOf doesn't work correctly in


          Issue ID: 20783
           Summary: std.string.lastIndexOf doesn't work correctly in CTFE
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: chalucha gmail.com

pragma(msg, "aa".lastIndexOf("ab"));

Returns 0 instead of -1.

Problem seems to be with:

as it continues foreach loop that should be stopped and instead upper for loop
should continue with next character.

Apr 28 2020