On Friday, 2 September 2016 at 21:16:02 UTC, Walter Bright wrote:
assert()s are there to check that impossible situations in the compiler don't actually happen. They are not for diagnosing errors in user code.

There are three things that will ideally happen when someone sees an assert:

* They'll submit a bug report to bugzilla.
* They'll come up with a reasonably simple test case to add to the bug report. * They'll find an immediate workaround for their code so they can get on with their life and not have to wait until the next compiler release.

The second and third would be greatly benefitted by the compiler attempting to tell us where the problem was encountered. For instance, if the assert was triggered while trying to generate code for function dmud.eventqueue.EventQueue!(Fiber).scheduleNear, I would know to look first and foremost at that function.

Yes, if I'm rebuilding my code often, I'll be able to narrow things down automatically, but I'm not as virtuous as I would like. And with templates, things get harder.

Reply via email to