Propagating Errors

Nicholas Wilson iamthewilsonator at hotmail.com
Fri Mar 8 06:45:24 UTC 2019


On Friday, 8 March 2019 at 06:34:00 UTC, FeepingCreature wrote:
> On Friday, 8 March 2019 at 06:09:30 UTC, Nicholas Wilson wrote:
>> This works nicely for __traits compiles, I'm not so sure about 
>> is expressions (though I'd love to be shown otherwise).
>
> I'm not sure what the problem with `is` is? `is` is also 
> designed to return false on compile failure and true on 
> success, so replacing its return value with an ErrorObject 
> doesn't seem like it *should* break things.

But it also returns false if the expression is false

`is(T==int)` could return false because T is an error AST node, 
because T is undefined in the context or because T is not `int`. 
I'm missing how you would handle the latter case.


More information about the Digitalmars-d mailing list