Feature request: __traits(canInstantiate), like __traits(compiles) but without suppressing syntax errors

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Jan 22 17:49:49 UTC 2020


On Wed, Jan 22, 2020 at 03:53:15PM +0000, Atila Neves via Digitalmars-d wrote:
> On Wednesday, 15 January 2020 at 18:13:08 UTC, H. S. Teoh wrote:
> > On Wed, Jan 15, 2020 at 03:13:08PM +0000, FeepingCreature via
> > Digitalmars-d wrote:
> > > Right now it's impossible to check "is there a valid (template)
> > > specialization for this function call" without also saying "and by
> > > the way, if there's a syntax error in the function, suppress the
> > > error and return false."
> > > 
> > > This makes many Phobos and library functions very annoying to use.
> > 
> > Yeah, the error-gagging method of speculative template instantiation
> > has been costing me lots of wasted time, too,
> 
> I've somehow only just discovered that `-verrors=spec` is a thing that
> one can pass to dmd. Does that help?

Only barely, because it generally produces pages upon pages of
irrelevant errors, and I have to save the output to a file and search
for keywords just to find approximately where the error is. And *then* I
have to decipher which of the errors are actually relevant.

IOW it's a pretty awful user experience.


T

-- 
I don't trust computers, I've spent too long programming to think that they can get anything right. -- James Miller


More information about the Digitalmars-d mailing list