Bug 11480 – `alias` template argument accepts `struct`, `class`, and `union` types and also loses all qualifiers
Status
RESOLVED
Resolution
WONTFIX
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-09T02:05:54Z
Last change time
2020-07-08T10:35:07Z
Keywords
accepts-invalid, wrong-code
Assigned to
No Owner
Creator
Denis Shelomovskii
Comments
Comment #0 by verylonglogin.reg — 2013-11-09T02:05:54Z
---
template t(alias T) { }
static assert(!__traits(compiles, t!int)); // ok
static assert(!__traits(compiles, t!Object)); // fails
---
It also loses all qualifiers, e.g. this passes:
---
template X(alias T) { alias X = T; }
static assert(is(X!(const Object) == Object));
---
As a result e.g. `std.typetuple` module is broken for qualified types.
Comment #1 by nick — 2020-07-08T10:35:07Z
Passing int is now ok. Thanks for filing this about lost qualifiers though. For the qualifiers, I'm closing this in favour of Issue 20899.