On Thursday, 27 November 2014 at 13:07:59 UTC, Suliman wrote:
Full function look like this:

auto parseConfig()
{
        auto config = Ini.Parse(getcwd ~ "\\" ~ "config.ini");
        string txtlinks = getcwd ~ "\\" ~ config.getKey("input_links");
        if(!exists(txtlinks))
        {
                writeln("Can't find input file with list of links.");
                return;
        }
        auto lines = File(txtlinks, "r").byLine;
        return lines;

}

You have two return statements in your function. Each of them returns a result of a different type (the first one returns a "void" result). That's not allowed.

Instead of writing "Can't find input file" and then returning, consider throwing an exception. Then you only have one return statement, and one return type.

Graham

Reply via email to