Jump to page: 1 2
Thread overview
[Issue 14145] opDispatch should be considered over UFCS
Feb 08, 2015
Adam D. Ruppe
Feb 08, 2015
Timothee Cour
Feb 08, 2015
Adam D. Ruppe
[Issue 14145] opDispatch not considered when function body doesn't compile
Feb 08, 2015
Timothee Cour
Feb 08, 2015
Timothee Cour
May 16, 2018
Simen Kjaeraas
May 16, 2018
Simen Kjaeraas
May 16, 2018
Nick Treleaven
Aug 20, 2018
Mike Franklin
Mar 19, 2021
Dlang Bot
Mar 22, 2021
Dlang Bot
Feb 16, 2022
Adam D. Ruppe
Feb 17, 2022
RazvanN
Feb 17, 2022
Dlang Bot
February 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14145

Adam D. Ruppe <destructionator@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator@gmail.com

--- Comment #1 from Adam D. Ruppe <destructionator@gmail.com> ---
Not a bug (though a common mistake that the compiler offers zero help with) - you forgot to import std.stdio, so the opDispatch didn't compile and that's why it wasn't considered.

--
February 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14145

Timothee Cour <timothee.cour2@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timothee.cour2@gmail.com

--- Comment #2 from Timothee Cour <timothee.cour2@gmail.com> ---
I forgot to mention: the naked 'writeln' was intentional in this bug report. the error occurs when the template body of opDispatch is not compilable (eg as in the example, import std.stdio is missing).

The correct behavior IMO should be to say:
error : could not resolve writeln.

Furthermore to counter your argument saying this is not a bug:

replace 'void fun(){}' by 'void foo(A a){}'
now it compiles whereas is shouldn't.

--
February 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14145

--- Comment #3 from Adam D. Ruppe <destructionator@gmail.com> ---
Yeah, I agree that would be nice. And actually the docs don't say what should happen when opDispatch fails to compile http://dlang.org/operatoroverloading.html#dispatch

so ok, now I agree with you, but I think it should be retitled to focus on just the opDispatch, the ufcs is unrelated. If it fails to compile it will say "no such property" which has the same root cause and is equally unhelpful.

--
February 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14145

Timothee Cour <timothee.cour2@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|opDispatch should be        |opDispatch not considered
                   |considered over UFCS        |when function body doesn't
                   |                            |compile

--
February 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14145

--- Comment #4 from Timothee Cour <timothee.cour2@gmail.com> ---
You're right that UFCS is not root cause; i've updated the title.
indeed, if we remove 'void foo' entirely it errors with "Error: no property
'foo' for type 'A'" instead of erroring with what it should:
main.d(13): Error: 'writeln' is not defined, perhaps you need to import
std.stdio; ?
main.d(22): Error: template instance main.A.opDispatch!("foo") error
instantiating

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

Simen Kjaeraas <simen.kjaras@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx

--- Comment #5 from Simen Kjaeraas <simen.kjaras@gmail.com> ---
*** Issue 12951 has been marked as a duplicate of this issue. ***

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

Simen Kjaeraas <simen.kjaras@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |justin@economicmodeling.com

--- Comment #6 from Simen Kjaeraas <simen.kjaras@gmail.com> ---
*** Issue 8387 has been marked as a duplicate of this issue. ***

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

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john.michael.hall@gmail.com

--- Comment #7 from Nick Treleaven <nick@geany.org> ---
*** Issue 18863 has been marked as a duplicate of this issue. ***

--
August 20, 2018
https://issues.dlang.org/show_bug.cgi?id=14145

Mike Franklin <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=19181

--
November 23, 2019
https://issues.dlang.org/show_bug.cgi?id=14145

Ernesto Castellotti <erny.castell@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |erny.castell@gmail.com
           Hardware|x86_64                      |All
                 OS|Mac OS X                    |All

--
« First   ‹ Prev
1 2