static assert(0) in template is a disaster

Paul Backus snarwin at gmail.com
Wed Jun 17 10:13:03 UTC 2020


On Wednesday, 17 June 2020 at 01:26:48 UTC, Andrei Alexandrescu 
wrote:
> On 6/16/20 7:01 PM, Paul Backus wrote:
>> I agree that this is a bug, but it is a bug in the design of 
>> the language itself, not the implementation.
>
> Is that a sort of a compile-time race condition? If that's the 
> case, D should deem the program ill-formed with no diagnostic 
> required.

Unfortunately it is quite easy to run into this sort of thing in 
real life if you use templates and design-by-introspection. See 
below for an example:

https://github.com/pbackus/sumtype/issues/35


More information about the Digitalmars-d mailing list