Bug 11125 – UFCS instantiation of template causes template constraint to be skipped

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-25T12:55:00Z
Last change time
2013-09-27T00:51:14Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2013-09-25T12:55:29Z
----- import std.traits; template filter(alias predfun) if (is(ReturnType!predfun == bool)) { static assert(is(ReturnType!predfun == bool)); auto filter(Range)(Range r) { } } void main() { filter!((int a) => a + 1)([1]); // fails in constraint [1].filter!((int a) => a + 1); // fails internally in static assert! } ----- The bug seems to be fixed in 2.064 git-head, but I can't recall if I've seen it filed as a bug. Is this a duplicate? We should make sure this test-case gets added if the bug wasn't fixed on purpose.
Comment #1 by k.hara.pg — 2013-09-25T19:50:48Z
(In reply to comment #0) > The bug seems to be fixed in 2.064 git-head, but I can't recall if I've seen it > filed as a bug. Is this a duplicate? We should make sure this test-case gets > added if the bug wasn't fixed on purpose. As far as I know, duplicated issue had not filed in bugzilla. But, from bisecting, I found the bug was fixed in the PR. https://github.com/D-Programming-Language/dmd/pull/2337 In there, I had also intended *normalizing* the evaluation order of template instantiations. So I can say that the bugfix was _half_ intended. To complete the fix, I opened a PR for adding a test case. https://github.com/D-Programming-Language/dmd/pull/2589 Thank you.
Comment #2 by k.hara.pg — 2013-09-25T19:52:14Z
(In reply to comment #1) > But, from bisecting, I found the bug was fixed in the PR. > https://github.com/D-Programming-Language/dmd/pull/2337 Sorry I pasted incorrect URL. Correct is: https://github.com/D-Programming-Language/dmd/pull/1660
Comment #3 by github-bugzilla — 2013-09-26T22:23:49Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/818448500d7e015816b19f391985e1fb72947acc fix Issue 11125 - UFCS instantiation of template causes template constraint to be skipped Additionally improve lambda formatting in error messages https://github.com/D-Programming-Language/dmd/commit/5e692dac924ad485c0365a067f8a53790caebc6f Merge pull request #2589 from 9rnsr/fix11125 Issue 11125 - UFCS instantiation of template causes template constraint to be skipped