error-type equality, intended ?

user1234 user1234 at 12.de
Tue Mar 3 15:18:29 UTC 2026


On Tuesday, 3 March 2026 at 14:46:56 UTC, Paul Backus wrote:
> I think it's probably accidental that `is(T == U)` 
> short-circuits to `is(T)` if `T` does not exist. If I were to 
> design a "version 3.0" of the D language, starting from 
> scratch, I would not include this behavior.
>
> Unfortunately, it has been around for such a long time, and is 
> depended on by so much existing code, that changing it is not 
> realistically possible, even with editions.

So if I follow your reasoning, you think it's an implementation 
accident. Actually there's an aspect that makes the current D 
behavior absolutly correct: that can be seen as comparing two NaN.


More information about the Digitalmars-d-learn mailing list