Bug 23578 – Types are not matched to alias parameters in "is" expression

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-12-24T08:31:39Z
Last change time
2022-12-25T03:23:06Z
Keywords
pull
Assigned to
No Owner
Creator
Max Samukha

Comments

Comment #0 by maxsamukha — 2022-12-24T08:31:39Z
struct S(alias a) { } static if (is(S!int == S!a, alias a)) pragma(msg, a); else static assert(false); Output: onlineapp.d(4): Error: static assert: `false` is false I don't know whether it's a bug or enhancement. The spec is unclear on this. It is reasonable to expect 'alias' parameters in 'is' expressions to be treated consistently with template parameters.
Comment #1 by dlang-bot — 2022-12-25T01:23:55Z
@maxhaton created dlang/dmd pull request #14738 "Fix Issue 23578 - Pattern match alias template parameters in is expre…" fixing this issue: - Fix Issue 23578 - Pattern match alias template parameters in is expressions. Ended up as a relatively simple diff - finding where to put it took a while. https://github.com/dlang/dmd/pull/14738
Comment #2 by dlang-bot — 2022-12-25T03:23:06Z
dlang/dmd pull request #14738 "Fix Issue 23578 - Pattern match alias template parameters in is expre…" was merged into master: - 017b66355337c28986d5b433279b3584a99b3cb9 by mhh: Fix Issue 23578 - Pattern match alias template parameters in is expressions. Ended up as a relatively simple diff - finding where to put it took a while. https://github.com/dlang/dmd/pull/14738