[Issue 23817] Reject `is` alias template instance TypeSpecialization when TemplateParameterList supplied

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 31 11:09:38 UTC 2023


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

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel at live.nl

--- Comment #2 from Dennis <dkorpel at live.nl> ---
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.

--


More information about the Digitalmars-d-bugs mailing list