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

--- Comment #8 from Ernesto Castellotti <erny.castell@gmail.com> ---
This issue makes it practically impossible to use opDispatch with decent
diagnostics, I think it should be solved as soon as possible.
Would any compiler expert want to take it?

--
September 03, 2020
https://issues.dlang.org/show_bug.cgi?id=14145

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com

--- Comment #9 from Steven Schveighoffer <schveiguy@yahoo.com> ---
Ran into this recently also.

What I have been doing to figure out why it's not working is to explicitly call opDispatch:

A.init.opDispatch!"foo"();

IMO, if no other valid members exist, then opDispatch should be used, even if it doesn't compile (and the subsequent error message printed).

I can see the utility in something like:

struct A
{
   T wrapped;
   auto opDispatch(string m, Args...)(Args args) {
       mixin("return wrapped." ~ m ~ "(args);");
   }
}

Without having to use a constraint to ensure the call is possible. But the cost for this is pretty steep (confusing and misleading error messages). Whether opDispatch is *matched* or not should not depend on the body, only the signature and constraints. This is in line with all other function templates.

--
September 03, 2020
https://issues.dlang.org/show_bug.cgi?id=14145

--- Comment #10 from hsteoh@quickfur.ath.cx ---
I've also run into this before, and it's nigh impossible to debug if you didn't realize opDispatch was involved, because declining instantiation rather than generating a compile error may cause overload resolution to move to another, unintended overload, which may in turn have some deeply-nested templates which fails in some deeply-nested scope. You'd trace the error all the way back out the entire instantiation chain, then be left scratching your head as to why that template was even chosen in the first place, and it may take a while to realize opDispatch was the intended call target but due to suppression of errors it was silently skipped.

As Steven said, whether opDispatch is chosen should not depend on the body, but only on the declaration and sig constraints. Any errors in the body should be a hard compile error.  For method-forwarding templates, it should be easy enough to use __traits(hasMember) in opDispatch's sig constraints to decide whether or not to accept instantiation. Small price for greatly improving error reporting involving opDispatch.

--
March 19, 2021
https://issues.dlang.org/show_bug.cgi?id=14145

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

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

--- Comment #11 from Dlang Bot <dlang-bot@dlang.rocks> ---
@thewilsonator created dlang/dmd pull request #12288 "Fix issue 14145 - opDispatch not considered when function body doesn'…" fixing this issue:

- Fix issue 14145 - opDispatch not considered when function body doesn't compile

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

--
March 22, 2021
https://issues.dlang.org/show_bug.cgi?id=14145

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #12 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #12288 "Fix issue 14145 - opDispatch not considered when function body doesn'…" was merged into master:

- 7fde6366daf146efc37d81f54d7265de2da8c3ff by Nicholas Lindsay Wilson:
  Fix issue 14145 - opDispatch not considered when function body doesn't
compile

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

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

Steven Schveighoffer <schveiguy@gmail.com> changed:

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

--- Comment #13 from Steven Schveighoffer <schveiguy@gmail.com> ---
Reopening, this is still not "fixed", the PR just changed the error messge.

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #14 from Adam D. Ruppe <destructionator@gmail.com> ---
Also adding Razvan to this one as it is a perpetually annoying opDispatch error bug Steve and I have had to deal with and complained about on the forum for years now. It used to work much better.

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |regression

--- Comment #15 from RazvanN <razvan.nitu1305@gmail.com> ---
Regression introduced by: https://github.com/dlang/dmd/pull/1981

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

--- Comment #16 from Dlang Bot <dlang-bot@dlang.rocks> ---
@RazvanN7 created dlang/dmd pull request #13679 "Fix Issue 14145 - opDispatch not considered when function body doesn't compile" fixing this issue:

- Fix Issue 14145 - opDispatch not considered when function body doesn't compile

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

--
1 2
Next ›   Last »