alias A(T) = ...;
enum ati1 = is(int == A!int); // OK
enum ati2 = is(int == A!T, T); // can't infer
The second `is` expression should error because DIP1023 is not implemented so the result is always false.
PR incoming.
Comment #1 by dlang-bot — 2023-03-30T18:37:59Z
@ntrel created dlang/dmd pull request #15053 "Fix Issue 23817 - `is` alias template instance specialization with Te…" fixing this issue:
- Fix Issue 23817 - `is` alias template instance specialization with TemplateParameterList
https://github.com/dlang/dmd/pull/15053
Comment #2 by dkorpel — 2023-03-31T11:09:38Z
I don't think it should be an error.
> The second `is` expression should error because DIP1023
> is not implemented so the result is always false.
It's not always false, it's only guaranteed to be false if `A` is an alias template.
is-expressions are used in generic code and supposed to be lenient. Note that this compiles as well:
```
enum b = is(T); // T is not defined
static assert(!b); // result is false, not an error
static assert(is(int)); // result is always true, not an error
```
Requiring an extra is-expression to check "am I not passing an alias template to my actual is-expression?" is clumsy.
Comment #3 by robert.schadek — 2024-12-13T19:28:06Z