On Wednesday, 21 October 2015 at 11:25:17 UTC, Kagamin wrote:
https://issues.dlang.org/show_bug.cgi?id=15027 It's a general problem with alias this being an incomplete subtyping.
IMHO, alias this is a disaster for templated code - e.g. it's way too easy for something to pass a template constraint thanks to alias this but then not actually be converted via the alias in the function, so it either ends up not compiling or having weird results. And as the recent problems with rangifying functions show, taking a function that accepts explicit types and changing it to so that it's templated and thus using a template constraint rather than explicit types is almost certainly going to break code that involves alias this. At this point, I think that we're just stuck with it, but honestly, if we could go back, I'd strongly argue for ditching the ability to add implicit conversions to a type and see how far we could get without them. Sure, they can be useful upon occasion, but I really don't think that they're worth the pain overall - especially when you use templates as heavily as we do.
- Jonathan M Davis
