[RFC] Fix issue 12285, issue 12286, issue 12230

https://d.puremagic.com/issues/show_bug.cgi?id=12285
https://d.puremagic.com/issues/show_bug.cgi?id=12286
https://d.puremagic.com/issues/show_bug.cgi?id=12230

~~DEPENDS ON https://github.com/D-Programming-Language/dmd/pull/2824~~

This fixes some inconsistencies with template alias parameters (12230) while avoiding breaking code (12285, 12286).

This pull request is experimental and a work-in-progress, please don't merge yet.