[Issue 16459] opDispatch gives obtuse error when dispatching to a function that doesn't exist

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 10 13:39:56 UTC 2022


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |WORKSFORME

--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
This seems to have been improved now. In the first case it gives:

test.d(14): Error: no property `doSomething` for `someObject` of type
`test.SomeObject!int`
test.d(14):        potentially malformed `opDispatch`. Use an explicit
instantiation to get a better error message

So, at least it gives you a hint that this may be the problem.

The idea is that currently the compiler cannot know if the error comes from
passing the wrong arguments to opDispatch or if the error comes from within the
innards of opDispatch that is why it just asks the user to call opDispatch
explicitly.

I think that until we find a way to deal with opDispatch this should be enough.

--


More information about the Digitalmars-d-bugs mailing list