[Issue 16569] New: Assertion failure on splitter.back on empty string

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Oct 1 10:53:35 PDT 2016


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

          Issue ID: 16569
           Summary: Assertion failure on splitter.back on empty string
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: neuranuz at gmail.com

import std.stdio;
import std.algorithm;
import std.range;
import std.string;

void main()
{
    string str = "";

    writeln( splitter(str, '.').back );
}

core.exception.AssertError at std/algorithm/iteration.d(3132): Assertion failure
----------------
??:? _d_assert [0x43dd1f]
??:? void std.algorithm.iteration.__assert(int) [0x4432b0]
??:? pure @property @safe immutable(char)[]
std.algorithm.iteration.splitter!("a == b", immutable(char)[],
char).splitter(immutable(char)[], char).Result.back() [0x43b8d6]
??:? _Dmain [0x43ae41]
??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x43e33e]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).tryExec(scope void delegate()) [0x43e288]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).runAll() [0x43e2fa]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).tryExec(scope void delegate()) [0x43e288]
??:? _d_run_main [0x43e1f9]
??:? main [0x43d049]

--


More information about the Digitalmars-d-bugs mailing list