Thread overview
[Issue 4936] Better error when type inference fails due to incorrect template parameter type
Feb 11, 2018
Seb
Feb 12, 2018
Jesse Phillips
Feb 12, 2018
Seb
Dec 17, 2022
Iain Buclaw
Feb 02, 2023
RazvanN
February 11, 2018
https://issues.dlang.org/show_bug.cgi?id=4936

Seb <greensunny12@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |greensunny12@gmail.com
         Resolution|---                         |WONTFIX

--- Comment #4 from Seb <greensunny12@gmail.com> ---
This works:

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

   completeSort(foo.assumeSorted, bar.assumeSorted);
}
---

https://run.dlang.io/is/aeO4fp

> Clearly, no one is using completeSort at all

Yeah if it's open for eight years, that's a very good sign no one uses it... I'm closing this as it's too old for an regression and assumeSorted works.

--
February 12, 2018
https://issues.dlang.org/show_bug.cgi?id=4936

--- Comment #5 from Jesse Phillips <Jesse.K.Phillips+D@gmail.com> ---
Seb, this is specifically about the error message poorly directing the user to provide a SortedRange. This was more confusing to me since I hit the issue after the library change, rather than when initially writing the code.

As I don't know exact changes to improve the error message I'll leave it closed, but it is a larger issue using templates and type inference which could be improved.

--
February 12, 2018
https://issues.dlang.org/show_bug.cgi?id=4936

Seb <greensunny12@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #6 from Seb <greensunny12@gmail.com> ---
Argh sorry - I was too busy working myself through old issues. Thanks for the reminder.

-> REOPENED

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=4936

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4

--
February 02, 2023
https://issues.dlang.org/show_bug.cgi?id=4936

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |WORKSFORME

--- Comment #7 from RazvanN <razvan.nitu1305@gmail.com> ---
Right now the error is:

Error: none of the overloads of template `std.algorithm.sorting.completeSort`
are callable using argument types `!()(string[], string[])`
    Candidate is: `completeSort(alias less = "a < b", SwapStrategy ss =
SwapStrategy.unstable, Lhs, Rhs)(SortedRange!(Lhs, less) lhs, Rhs rhs)`

So it is pointing the declaration and it can be observed that `foo` is not SortedRange.

--