Thread overview
[Issue 4936] New: Regression(2.049) std.algorithm.completeSort doesn't match string arrays
Sep 24, 2010
Jesse Phillips
[Issue 4936] Better error when type inference fails due to incorrect template parameter type
Oct 26, 2010
Jesse Phillips
Oct 26, 2010
Jesse Phillips
Jul 02, 2012
Bernard Helyer
September 24, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4936

           Summary: Regression(2.049) std.algorithm.completeSort doesn't
                    match string arrays
           Product: D
           Version: D2
          Platform: Other
        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-09-24 16:37:19 PDT ---
Basically two string[] fail to mach the completeSort signature. This worked with 2.048

import std.algorithm;

void main() {
   auto foo = ["a the way home", "can I say"];
   auto bar = ["be it here or there", "you may"];

   completeSort(foo, bar);
}

test.d(7): Error: template std.algorithm.completeSort(alias less = "a <
b",SwapStrategy ss = SwapStrategy.unstable,Range1,Range2) if
(hasLength!(Range2) && hasSlicing!(Range2)) does not match any function
template declaration

test.d(7): Error: template std.algorithm.completeSort(alias less = "a <
b",SwapStrategy ss = SwapStrategy.unstable,Range1,Range2) if
(hasLength!(Range2) && hasSlicing!(Range2)) cannot deduce template function
from argument types !()(string[],string[])

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 25, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4936


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei@metalanguage.com
         AssignedTo|nobody@puremagic.com        |andrei@metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 26, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4936


Jesse Phillips <Jesse.K.Phillips+D@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |
          Component|Phobos                      |DMD
         AssignedTo|andrei@metalanguage.com     |nobody@puremagic.com
            Summary|Regression(2.049)           |Better error when type
                   |std.algorithm.completeSort  |inference fails due to
                   |doesn't match string arrays |incorrect template
                   |                            |parameter type
           Severity|normal                      |enhancement


--- Comment #1 from Jesse Phillips <Jesse.K.Phillips+D@gmail.com> 2010-10-26 12:20:41 PDT ---
completeSort no longer takes arbitrary ranges, it takes a SortedRange as the first parameter, and that is causing the error.

I guess the easiest would be to include the parameter list, but maybe that would make it too cluttered?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 26, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4936



--- Comment #2 from Jesse Phillips <Jesse.K.Phillips+D@gmail.com> 2010-10-26 12:51:39 PDT ---
Looks like the example code doesn't actually work either.

import std.algorithm;
import std.range;

void main() {
int[] a = [ 1, 2, 3 ];
int[] b = [ 4, 0, 6, 5 ];
completeSort(assumeSorted(a), b);
assert(a == [ 0, 1, 2 ]);
assert(b == [ 3, 4, 5, 6 ]);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 02, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4936


Bernard Helyer <blood.of.life@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |blood.of.life@gmail.com


--- Comment #3 from Bernard Helyer <blood.of.life@gmail.com> 2012-07-02 02:54:58 PDT ---
Really? This has been broken since _049_ and no one has commented on it? Clearly, no one is using completeSort at all.

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