www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11125] New: UFCS instantiation of template causes template constraint to be skipped

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11125

           Summary: UFCS instantiation of template causes template
                    constraint to be skipped
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



12:55:29 PDT ---
-----
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 25 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11125


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic, pull




 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. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 25 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11125





 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 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 25 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11125




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


Issue 11125 - UFCS instantiation of template causes template constraint to be
skipped

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 26 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11125


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 27 2013