dmd 1.074 and 2.059 release
Alex Rønne Petersen
xtzgzorex at gmail.com
Fri Apr 13 16:59:40 PDT 2012
On 14-04-2012 01:49, Andrej Mitrovic wrote:
> On 4/14/12, Robert Clipsham<robert at octarineparrot.com> 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
More information about the Digitalmars-d-announce
mailing list