On Wed, 2016-09-07 at 09:03 +0000, ketmar via Digitalmars-d-learn wrote: > […] > > alas, no jokes here. within the current D sytnax there is simply > no way to make that error less cryptic. :-(
Well that will be the end of any traction for D then. C++, Java, Groovy, etc. error messages prove that error reporting is something you get right or you have no users that are not working under Stockholm Syndrome. > even pointing at the failed constraint is fairly hard with > current DMDFE code (that's why nobody did it yet), and show > custom error for that is nearly impossible. we can't write "catch > all" template with static assert, 'cause it catches everything, > which is not desirable. > > i myself didn't found even acceptable solution for this mess. > sure, at least pointing to failed constraint is something we > should have, but in your case it is of little help, actually. > > probably adding `map` overload which accepts static arrays and > does `static assert(0, "please use slice for static arrays");` > may help in this case. I think bearophile suggested adding amap many moons ago. I suspect this will never happen due to array(map(…)) which is fine. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part