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.
By the way, it seems it does not support implicit type conversions.
(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; } -----
https://github.com/D-Programming-Language/dlang.org/pull/555
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.