Bug 8315 – Invalid nested-ref check in template constraint
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-28T22:24:00Z
Last change time
2012-06-29T13:55:34Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2012-06-28T22:24:28Z
This bug is introduced by the fix issue 8241.
Reported by @meh in github.
https://github.com/D-Programming-Language/dmd/pull/1006#issuecomment-6646067
> This pull broke something.
>
> I didn't manage to get a reduced testcase but I get this error:
>
> nucular/protocols/http/headers.d(65): Error: template std.algorithm.countUntil does not match any function template declaration
> /usr/include/d/std/algorithm.d(3801): Error: template std.algorithm.countUntil cannot deduce template function from argument types !(__lambda4)(Header[])
> nucular/protocols/http/headers.d(65): Error: template instance countUntil!(__lambda4) errors instantiating template
> When compiling _internal = _internal.remove(_internal.countUntil!(a => a.name == name));.
>
> The incriminating commit is 6cf404d, before that it compiles properly.
Reduced test case:
void main()
{
bool b;
foo!(a => b)();
}
void foo(alias pred)()
if (is(typeof(pred(1)) == bool)) {}