[Issue 15459] [REG2.065.0] stdin.byLine.each!(map!somefunc) compiles, fails to link with ld

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 14 06:29:28 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=15459

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |bugzilla at digitalmars.com
         Resolution|---                         |WORKSFORME

--- Comment #11 from Walter Bright <bugzilla at digitalmars.com> ---

(In reply to Simon Naarmann from comment #0)
> http://dpaste.dzfl.pl/ce501c212d32
> 
> This code calls byLine, each, map!somefunc. It compiles fine, but fails to
> link. Tested on my Linux machine with DMD 2.069.2 and on dpaste with DMD
> 2.069.1.
> 
> Expected: Either an error during compilation, or a well-linked executable.
> 
> Code copied here for convenience:
> 
>     #!/usr/bin/rdmd
> 
>     import std.stdio;
>     import std.algorithm;
> 
>     char somefunc(in char c)
>     {
>         return c;
>     }
> 
>     void main()
>     {
>         stdin
>             .byLine
>             .each!(map!somefunc);
>     }
> 
> dmd outputs:

I get:

test.d(13): Error: template `std.algorithm.iteration.each!(map).each` cannot
deduce function from argument types `!()(ByLine!(char, char))`, candidates are:
c:\cbx\mars\phobos\std\algorithm\iteration.d(890):       
`std.algorithm.iteration.each!(map).each(Range)(Range r) if
(!isForeachIterable!Range && (isRangeIterable!Range || __traits(compiles,
typeof(r.front).length)))`
c:\cbx\mars\phobos\std\algorithm\iteration.d(925):       
`std.algorithm.iteration.each!(map).each(Iterable)(auto ref Iterable r) if
(isForeachIterable!Iterable || __traits(compiles,
Parameters!(Parameters!(r.opApply))))`

So it works for me.

--


More information about the Digitalmars-d-bugs mailing list