On Friday, 30 October 2015 at 14:39:47 UTC, Atila Neves wrote:
From the discussion here: http://forum.dlang.org/post/tgnxocozkurfvmxqo...@forum.dlang.org, I thought a library solution would do to fix the issue of getting decent error messages when a type fails to satisfy a template constraint that it was meant to, such as `isInputRange`. So I submitted a PR (https://github.com/D-Programming-Language/phobos/pull/3677), it's been there ever since and doesn't seem like it'll go anywhere from the discussion (http://forum.dlang.org/post/qvofihzmappftdiwd...@forum.dlang.org).

So the only other way is a DIP (http://wiki.dlang.org/DIP84) for language and compiler support for static inheritance. It's backwards-compatible and IMHO worth looking at.

Please let me know what you think.

Atila

To be honest. The idea of having a library fix error messages seems sort of like a band-aid solution rather than a real solution. Don't get me wrong, I use band aids, but I think the DIP solution is a more proper approach. As far as the DIP, I like what was proposed.

Structs can't currently inherit and so wouldn't need static. However, it might be preferable to require it anyway for parity with classes:

I would say I agree that it should be required, just for consistency sake.

Reply via email to