www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4467] New: type deduction fails when combining array() and uniq()

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

           Summary: type deduction fails when combining array() and uniq()
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: Jesse.K.Phillips+D gmail.com
                CC: Jesse.K.Phillips+D gmail.com


--- Comment #0 from Jesse Phillips <Jesse.K.Phillips+D gmail.com> 2010-07-15
15:55:40 PDT ---
This code (or code similar to it) use to work within the last 4 releases. I
don't know whether it is a bug in Phobos or DMD.

import std.algorithm;
import std.array;

void main() {
    auto a = ["hello", "there", "you", "allow", "you", "me"];

    auto b = array(uniq(a));
}

test.d(7): Error: template std.array.array(Range) if (isForwardRange!(Range))
does not match any function template declaration
test.d(7): Error: template std.array.array(Range) if (isForwardRange!(Range))
cannot deduce template function from argument types !()(Uniq!(pred,string[]))

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 15 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4467


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from yebblies <yebblies gmail.com> 2010-07-15 19:40:14 PDT ---
This is a phobos bug caused by the addition of save() to the definition of a
forward range.
Uniq is one of around 22 ranges in phobos that appear to be forward ranges but
have not been updated to meet this requirement. (bug4363)

*** This issue has been marked as a duplicate of issue 4363 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 15 2010