Skip to content

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

@dlangBugzillaToGithub

Description

@dlangBugzillaToGithub

Simon Naarmann (@SimonN) reported this on 2015-12-17T02:58:39Z

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

CC List

Description

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:

/d773/f942.o: In function `_D3std9algorithm9iteration32__T3mapS21_D4f9428somefuncFxaZaZ11__T3mapTAaZ3mapFNaNbNiNfAaZS3std9algorithm9iteration41__T9MapResultS21_D4f9428somefuncFxaZaTAaZ9MapResult': /d773/f942.d:
(.text._D3std9algorithm9iteration32__T3mapS21_D4f9428somefuncFxaZaZ11__T3mapTAaZ3mapFNaNbNiNfAaZS3std9algorithm9iteration41__T9MapResultS21_D4f9428somefuncFxaZaTAaZ9MapResult+0x30):
undefined reference to 
`_D3std9algorithm9iteration41__T9MapResultS21_D4f9428somefuncFxaZaTAaZ9MapResult6__ctorMFNaNbNcNiNfAaZS3std9algorithm9iteration41__T9MapResultS21_D4f9428somefuncFxaZaTAaZ9MapResult' 
collect2: error: ld returned 1 exit status 
--- errorlevel 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions