On 14-04-2012 01:49, Andrej Mitrovic wrote:
On 4/14/12, Robert Clipsham<[email protected]>  wrote:
It can't throw a Throwable

Well now I'm confused. According to TDPL p307:

"nothrow promises that the function won't throw an Exception. The
function is still allowed to throw the graver Throwable class."

And yet this is an error:

nothrow void foo() {
     throw new Throwable("");
}
void main() { }

test.d(6): Error: object.Throwable is thrown but not caught
test.d(4): Error: function test.foo 'foo' is nothrow yet may throw

So who is the outlier here?

That sounds like an error in TDPL. AFAIK nothrow means "may only throw Error".

--
- Alex

Reply via email to