More operators inside `is(...)` expressions
Steven Schveighoffer
schveiguy at gmail.com
Sun Aug 23 22:17:49 UTC 2020
On 8/23/20 5:52 PM, Dennis wrote:
> On Sunday, 23 August 2020 at 21:20:21 UTC, Steven Schveighoffer wrote:
>> What is the cost here? Just use the same AST node for the is
>> expression, and wrap it in a `not` AST node.
>
> What would `is(int != T, T)` mean? To me it sounds like T should be
> bound to an arbitrary type that's not int, but when you lower it to
> `!is(int == T, T)` it returns false.
BTW, what I would propose is that the following case be added as an is
Expression:
is(Type != TypeSpecialization)
As syntax sugar for:
!is(Type == TypeSpecialization)
And no other forms using != are valid.
-Steve
More information about the Digitalmars-d
mailing list