April 06, 2017
https://issues.dlang.org/show_bug.cgi?id=17299

          Issue ID: 17299
           Summary: Compile failure only on -de
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: jbc.engelen@gmail.com

The following code fragment compiles without any output with `-d` and `-dw` but errors with `-de`:

file std/aaa.d
```
@nogc void toLower(dchar)
{
}
```

file str.d
```
module std.str;

char front(T)(T) {
    return 'a';
}

char back(T)(T) {
    return 'a';
}

ptrdiff_t lastIndexOf(T)(const(T), dchar){
    import std.aaa;
    return 1;
}

bool endsWith(alias pred, R1, R2)(R1 doesThisEnd, R2 withThis)
   if (is(typeof(pred(doesThisEnd.back, withThis))))
{
    return false;
}

ptrdiff_t lastIndexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub) {
    return lastIndexOf(s, sub.front);

    if (endsWith!((a, b) => std.aaa.toLower(a))(s, sub))
        return 1;
}

void foo(string src) {
    src.lastIndexOf("_");
}
```

Commandline is `dmd -c -o- -de str.d` and errors with
```
str.d(30): Error: template std.str.endsWith cannot deduce function from
argument types !((a, b) => std.aaa.toLower(a))(const(char)[], const(char)[]),
candidates are:
str.d(20):        std.str.endsWith(alias pred, R1, R2)(R1 doesThisEnd, R2
withThis) if (is(typeof(pred(doesThisEnd.back, withThis))))
str.d(36): Error: template instance std.str.lastIndexOf!(char, char) error
instantiating
```

Compiles without issues with dmd 2.070.2

Perhaps duplicated/related to https://issues.dlang.org/show_bug.cgi?id=9960

--