Thread overview
[Issue 23817] Reject `is` alias template instance TypeSpecialization when TemplateParameterList supplied
Mar 30, 2023
Dlang Bot
Mar 30, 2023
Basile-z
Mar 31, 2023
Dennis
March 30, 2023
https://issues.dlang.org/show_bug.cgi?id=23817

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #1 from Dlang Bot <dlang-bot@dlang.rocks> ---
@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

--
March 30, 2023
https://issues.dlang.org/show_bug.cgi?id=23817

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
                 CC|                            |b2.temp@gmx.com
           Hardware|x86_64                      |All
                 OS|Linux                       |All
           Severity|enhancement                 |normal

--
March 31, 2023
https://issues.dlang.org/show_bug.cgi?id=23817

Dennis <dkorpel@live.nl> changed:

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

--- Comment #2 from Dennis <dkorpel@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.

--