Bug 10231 – Spec: Document typed alias parameter feature

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-01T13:54:00Z
Last change time
2014-04-23T00:12:55Z
Keywords
pull, spec
Assigned to
andrej.mitrovich
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2013-06-01T13:54:22Z
Recently Kenji mentioned that the following works: ----- struct X(alias int x) { } void main() { int i; alias X!i IVal; // ok float f; alias X!f FVal; // fail } ----- Even if this is allowed by the current syntax rules, it is largely an undocumented feature (compiler implementers could easily miss this feature as well). It should be properly documented.
Comment #1 by maxim — 2013-06-01T14:35:49Z
By the way, it seems it does not support implicit type conversions.
Comment #2 by andrej.mitrovich — 2013-06-01T14:37:18Z
(In reply to comment #1) > By the way, it seems it does not support implicit type conversions. For that I think I'd like this enhancement to work: ----- struct X(alias T x, T : int) { } void main() { short i; alias X!i IVal; } -----
Comment #3 by andrej.mitrovich — 2014-04-22T22:57:29Z
Comment #4 by github-bugzilla — 2014-04-23T00:12:54Z
Commits pushed to master at https://github.com/D-Programming-Language/dlang.org https://github.com/D-Programming-Language/dlang.org/commit/1b65c456b7a5c06aaad2945cb14edcc99f29d41a Fix Issue 10231 - Document typed alias parameters. https://github.com/D-Programming-Language/dlang.org/commit/2777f8da42e2f164aa1429d7734e85efc4c03be0 Merge pull request #555 from AndrejMitrovic/Fix10231 Issue 10231 - Document typed alias parameters.