June 25, 2017
https://issues.dlang.org/show_bug.cgi?id=15459

--- Comment #9 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
(In reply to ag0aep6g from comment #8)
> So the invalid front is supposed to be accepted (if it's never called)? Then I suppose the accepts-invalid aspect of this issue is WONTFIX.

Forward references and generally order of semantic analysis is a tricky subject and I'm not qualified to answer with authority whether the behaviour here can actually be called a bug or not, however I do know that we generally want the compiler to be as lazy as possible/reasonable for performance reasons. For example, currently unit tests are not even parsed without unittest, so you can put any series of tokens in an unittest block as long as the curly braces are balanced. So, even if there is a bug here, fixing it would not align with long-term goals.

> But it should link then, no?

Oh right, I missed that the test case you posted also exhibits the link failure.

--
June 25, 2017
https://issues.dlang.org/show_bug.cgi?id=15459

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|stdin.byLine.each!(map!some |[REG2.065.0]
                   |func) compiles, fails to    |stdin.byLine.each!(map!some
                   |link with ld                |func) compiles, fails to
                   |                            |link with ld
           Severity|major                       |regression

--- Comment #10 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
Regression (changing the compilation error into a link error + possible accepts-invalid) introduced in https://github.com/dlang/dmd/pull/2851

--
December 14, 2018
https://issues.dlang.org/show_bug.cgi?id=15459

Walter Bright <bugzilla@digitalmars.com> changed:

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

--- Comment #11 from Walter Bright <bugzilla@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.

--
December 16, 2018
https://issues.dlang.org/show_bug.cgi?id=15459

Simon Naarmann <eiderdaus@gmail.com> changed:

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

--- Comment #12 from Simon Naarmann <eiderdaus@gmail.com> ---
(In reply to Walter Bright from comment #11)
> So it works for me.

The code from the opening post now fails to compile in DMD v2.083.1 and the linker won't be called. That's good.

But ag0aep6g's reduced case from Comment 6 -- https://issues.dlang.org/show_bug.cgi?id=15459#c6 -- still compiles with DMD v2.083.1 on 64-bit Linux, then fails to link. Linker error below. Expected instead: That code should fail compilation, as annotated via /* should fail compilation */.

    /usr/bin/ld: a.o: in function `_D1a__T3mapZQfFNaNbNiNfZv':
    a.d:(.text._D1a__T3mapZQfFNaNbNiNfZv[_D1a__T3mapZQfFNaNbNiNfZv]+0x27):
undefined reference to
`_D1a__T9MapResultZQl6__ctorMFNaNbNcNiNfAaZSQBp__TQBqZQBu'
    collect2: error: ld returned 1 exit status
    Error: linker exited with status 1

Or should we file a separate bug for that?

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

--- Comment #13 from Walter Bright <bugzilla@digitalmars.com> ---
The Comment 6 example still fails to compile. It looks like the speculative
compilation in the `is(typeof(map))` wound up hiding the error in somefunc().

--
November 25, 2021
https://issues.dlang.org/show_bug.cgi?id=15459

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #14 from Dlang Bot <dlang-bot@dlang.rocks> ---
@RazvanN7 created dlang/dmd pull request #13359 "Fix Issue 15459 - [REG2.065.0] stdin.byLine.each!(map!somefunc) compiles, fails to link with ld" fixing this issue:

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

https://github.com/dlang/dmd/pull/13359

--
November 10, 2022
https://issues.dlang.org/show_bug.cgi?id=15459

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john.loughran.colvin@gmail.
                   |                            |com

--- Comment #15 from RazvanN <razvan.nitu1305@gmail.com> ---
*** Issue 16481 has been marked as a duplicate of this issue. ***

--
April 04, 2023
https://issues.dlang.org/show_bug.cgi?id=15459

--- Comment #16 from RazvanN <razvan.nitu1305@gmail.com> ---
*** Issue 19545 has been marked as a duplicate of this issue. ***

--
April 18, 2023
https://issues.dlang.org/show_bug.cgi?id=15459

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |default_357-line@yahoo.de

--- Comment #17 from RazvanN <razvan.nitu1305@gmail.com> ---
*** Issue 20237 has been marked as a duplicate of this issue. ***

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |siarhei.siamashka@hotmail.c
                   |                            |om

--- Comment #18 from RazvanN <razvan.nitu1305@gmail.com> ---
*** Issue 24282 has been marked as a duplicate of this issue. ***

--
1 2
Next ›   Last »