[Issue 15240] errors in isExpression with == not gagged when used in constraint

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Oct 23 06:50:23 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=15240

--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> ---
This is intentional behavior. In 'IsExpression', if the Type operand is
invalid, the latter arguments are not analyzed.

In this case, the type R in `static if (is(R == what)) ...` is undefined, then
what is not evaluated.

If you supply R as a valid type, the 'what' will cause an error.

alias R = int;
static if (is(R == what)) pragma(msg, "hi");

Prints:
---
test.d(2): Error: undefined identifier 'what'

--


More information about the Digitalmars-d-bugs mailing list