opDispatch compiles fine, but still fails to resolve?

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Aug 8 22:40:27 PDT 2014


On Sat, Aug 09, 2014 at 05:34:40AM +0000, Vlad Levenfeld via Digitalmars-d-learn wrote:
> Yep, replacing @property with auto did the trick.
> 
> The lack of error messages in opDispatch is frustrating. I realize
> that, due to tricks like __traits(compiles,
> Foo.testing_for_some_function), having opDispatch stop compilation if
> it fails is not going to work, but there's gotta be some way to expose
> what's going on with it when it fails. Maybe some kind of pragma to
> cause opDispatch to report its failures, I don't know.

Why would having opDispatch actually generate compile errors cause
problems for __traits(compiles,...)? __traits(compiles...) already works
fine with a whole bunch of other non-compiling stuff (by gagging errors
while it attempts them).

The problem with opDispatch is that it gags too much, even when the
resolution ultimately fails, so you're left with mysterious
"disappearances" of opDispatch with no hint as to what went wrong. I'm
not familiar with this part of DMD, but surely there's a way to make
this behave better??


T

-- 
"The number you have dialed is imaginary. Please rotate your phone 90 degrees and try again."


More information about the Digitalmars-d-learn mailing list