Fix issue 12890 - index based insert

https://issues.dlang.org/show_bug.cgi?id=12890

I have not yet reviewed the code, don't pull. It's a PR so it doesn't fall off the radar.