www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18215] New: std.array.replace throws a range violation if

https://issues.dlang.org/show_bug.cgi?id=18215

          Issue ID: 18215
           Summary: std.array.replace throws a range violation if from
                    range is longer than the array
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: greensunny12 gmail.com

---
auto arr = ["aaa.dd", "b"];
arr.replace("aaa.dd", ".");
assert(arr == [".", "b"]);
---

core.exception.RangeError array.d(2136): Range violation
----------------
??:? _d_arrayboundsp [0x5af019c6]

--
Jan 08 2018