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

Dennis <dkor...@live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkor...@live.nl

--- Comment #1 from Dennis <dkor...@live.nl> ---
Reduced to remove imports:
```D
template map(fun...)
{
    auto map(Range)(Range r)
    {
        alias RE = ElementType!Range;
        alias _fun = unaryFun!fun;
        assert(!is(typeof(_fun(RE.init)) ));
        MapResult!(_fun, Range)(r);
    }
}

struct MapResult(alias fun, Range)
{
    Range input;

    this(Range range)
    {
    }

    void front()
    {
        fun(input.front);
    }
}

template unaryFun(alias fun)
{
    alias unaryFun = fun;
}

template ElementType(R)
{
    static if (is(typeof(R.init.front) T))
        alias ElementType = T;
}

string front(string[] s)
{
    return "";
}

int dummyhash(string s)
{
    return 0;
}

void main()
{
    auto input = ["a", "b"];
    input.map!(s => s.map!dummyhash);
}
```

--

Reply via email to