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

Steven Schveighoffer schveiguy at gmail.com
Fri Jan 17 14:57:27 UTC 2020


On 1/17/20 12:54 AM, FeepingCreature wrote:
> 
> Would be nice, but would be a hard spec change. This is the sort of 
> thing that D should have been doing from the beginning, but we may be 
> too far in now for __traits(compiles) to be changed to do this. However, 
> this is the behavior I would ask for for __traits(canInstantiateWith).
> 

Just to point you at my previous thread on this: 
https://forum.dlang.org/post/q1jequ$r63$1@digitalmars.com

I think more tools for diagnosing why something doesn't happen would be 
good, but the request of "tell me if I was stupid" is I think impossible 
for the compiler to figure out.

-Steve


More information about the Digitalmars-d mailing list