Bug 23817 – Reject `is` alias template instance TypeSpecialization when TemplateParameterList supplied

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-03-30T18:34:45Z
Last change time
2024-12-13T19:28:06Z
Keywords
accepts-invalid, pull
Assigned to
No Owner
Creator
Nick Treleaven
Moved to GitHub: dmd#18161 →

Comments

Comment #0 by nick — 2023-03-30T18:34:45Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18161 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB