The use of an is expression with the form `is(typeof(foo))`, such as in `static if(is(typeof(maybe_this_exists))`, is not documented in <http://dlang.org/expression.html#IsExpression> and is not an obvious composition of documented D features. Therefore, it would be nice if this was documented.
Comment #1 by dfj1esp02 — 2015-11-05T12:45:13Z
Well, it reads:
---
Type is the type being tested. It must be syntactically correct, but it need not be semantically correct. If it is not semantically correct, the condition is not satisfied.
---
Is it not enough?
Comment #2 by dfj1esp02 — 2015-11-05T12:47:49Z
That said I would prefer it to be extended to just `is(foo)` to check correctness of a declaration without needing typeof.
Comment #3 by luis — 2015-11-06T16:36:34Z
No, I don't think it is at all obvious from the description of `is` and from the description of `typeof` that we can use `is(typeof(foo))` to check whether foo exists and therefore can be used.
Comment #4 by razvan.nitu1305 — 2022-07-29T09:04:22Z