On 02/19/2013 04:38 PM, cal wrote:
> Is this example from the docs still meant to work?
>
> int[] a = new int[3];
> int b;
> assert(collectException(a[4], b));

The example is wrong. a[4] throws an Error (not Exception) but collectException catches Exception by default.

Additionally, the example is doing something that is recommended against: Catching Error or a descendent of it.

Still, it can be told to catch by Error:

    assert(collectException!Error(a[4], b));

Ali

Reply via email to