[Issue 12451] Simple range mistake not caught by compiler

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 24 06:24:34 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12451


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra at gmail.com


--- Comment #1 from monarchdodra at gmail.com 2014-03-24 06:24:30 PDT ---
(In reply to comment #0)
> But the mistake is caught by the linker instead of the dmd, dmd 2.066alpha:

I'm getting a compile error on win32 head:

std\algorithm.d(469): Error: template std.algorithm.sum cannot deduce function
from argument types !()(int), candidates are:
std\algorithm.d(1079):        std.algorithm.sum(R)(R r) if (isInputRange!R &&
!isInfinite!R && is(typeof(r.front + r.front)))
std\algorithm.d(1090):        std.algorithm.sum(R, E)(R r, E seed) if
(isInputRange!R && !isInfinite!R && is(typeof(seed = seed + r.front)))
std\algorithm.d(503): Error: template std.algorithm.sum cannot deduce function
from argument types !()(int), candidates are:
std\algorithm.d(1079):        std.algorithm.sum(R)(R r) if (isInputRange!R &&
!isInfinite!R && is(typeof(r.front + r.front)))
std\algorithm.d(1090):        std.algorithm.sum(R, E)(R r, E seed) if
(isInputRange!R && !isInfinite!R && is(typeof(seed = seed + r.front)))
std\algorithm.d(515): Error: template std.algorithm.sum cannot deduce function
from argument types !()(int), candidates are:
std\algorithm.d(1079):        std.algorithm.sum(R)(R r) if (isInputRange!R &&
!isInfinite!R && is(typeof(r.front + r.front)))
std\algorithm.d(1090):        std.algorithm.sum(R, E)(R r, E seed) if
(isInputRange!R && !isInfinite!R && is(typeof(seed = seed + r.front)))
std\algorithm.d(416): Error: template instance std.algorithm.MapResult!(sum,
int[]) error instantiating
std\algorithm.d(469):        instantiated from here: map!(int[])
std\algorithm.d(416):        instantiated from here: MapResult!(map, int[][])
main.d(11):        instantiated from here: map!(int[][])

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


More information about the Digitalmars-d-bugs mailing list