Bug 3116 – clarify which type names are valid template alias parameters
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2009-06-30T04:54:00Z
Last change time
2014-04-18T09:12:06Z
Keywords
spec
Assigned to
nobody
Creator
kamm-removethis
Comments
Comment #0 by kamm-removethis — 2009-06-30T04:54:30Z
The spec says template alias parameters accept type names, but basic types don't work:
template T(alias a) { }
alias T!(int) ti; // error: does not match
alias T!(float) tf; // error: does not match
alias T!(Object) to; // ok
This seems to be because Type::toDsymbol returns NULL.
Comment #1 by bugzilla — 2009-07-03T12:57:31Z
Basic types are keywords, not names. This is an enhancement request.
Comment #2 by jarrett.billingsley — 2009-07-03T13:01:52Z
If template alias parameters are to act consistently with aliases, then it should "just work".
alias int X; // fine
alias X Y; // fine
Comment #3 by kamm-removethis — 2009-07-04T00:18:52Z
In that case I withdraw this enhancement request and rather ask that the D1 spec be clarified (where is 'type names' and 'D symbol' defined?).
Would the following replacements in the "Template Alias Parameters" section be correct?
typedef names -> enum, typedef, struct or class names (in the list of valid arguments)
type names -> class names (in the example)