Bug 12213 – DMD accepts invalid alias declaration

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-20T01:34:00Z
Last change time
2014-02-20T02:04:21Z
Keywords
accepts-invalid, spec
Assigned to
nobody
Creator
briancschott
Blocks
10233

Comments

Comment #0 by briancschott — 2014-02-20T01:34:24Z
template X(string a, string b) {} alias Y(string b) = X!("a", b); No part of the language specification says that this is valid. DMD seems to be accepting "alias" where "enum" is the correct keyword to use.
Comment #1 by k.hara.pg — 2014-02-20T02:04:21Z
template X(string a, string b) {} alias Y(string b) = X!("a", b); The alias declaration is equivalent with: template Y(string b) { alias Y = X!("a", b); } This is a new feature from 2.064, which had been proposed as DIP42. http://wiki.dlang.org/DIP42 And the feature will be finally documented in 2.065 release. https://github.com/D-Programming-Language/dlang.org/pull/371